Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Write something while app runing
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Marta  
View profile  
 More options Oct 31 2009, 10:29 pm
Newsgroups: microsoft.public.scripting.vbscript
From: "Marta" <I301...@hotmail.com>
Date: Sat, 31 Oct 2009 23:29:31 +0100
Local: Sat, Oct 31 2009 10:29 pm
Subject: Re: Write something while app runing

Thanks! It works!

"Tom Lavedas" <tglba...@cox.net> escribió en el mensaje de
noticias:49809721-17fd-489f-b12c-9ca851789...@k17g2000yqb.googlegroups.com...

> On Oct 30, 6:36 am, "Marta" <I301...@hotmail.com> wrote:
>> Hi! i need your herp for following:

>> My vbs launch an application:
>> Wscript.Echo "Application is running."
>> allwaySinc = "syncappw.exe -s  -m -lf ""c:\sinc_logs"" -e"
>> objShell.Run allwaySinc, 2, True

>> I would like write something while the app is running because it can take
>> several minutes. something like woulg be great!
>> ..........................................................................
>> ..........................................................................
>> .....................................................

>> Thanks in advance!
>> I301199

> Assuming the string of periods are to be displayed in a console window
> (at the command prompt), then something like this should do what you
> want when executed under the cscript.exe host ...

> Const HIDDEN_WINDOW = 0

> allwaySinc = "syncappw.exe -s  -m -lf ""c:\sinc_logs"" -e"

> Set oWMISrvc = GetObject("winmgmts:" _
>    & "{impersonationLevel=impersonate}!\\.\root\cimv2")
> Set oConfig = oWMISrvc.Get("Win32_ProcessStartup").SpawnInstance_
> oConfig.ShowWindow = HIDDEN_WINDOW
> Set oProcess = GetObject("winmgmts:{impersonationLevel=impersonate}!"
> _
>    & "\\.\root\cimv2:Win32_Process")
> errReturn = oProcess.Create(allwaySinc, null, oConfig, iProcessID)

> n = 0
> if errReturn = 0 then
>  do While IsRunning(iProcessID, oWMISrvc)
>    wsh.sleep 100
>    n = n + 1
>    if (n Mod 10) = 0 then wsh.StdOut.write "."
>    if n = 72 then n = 0 : wsh.echo
>    loop
> end if

> Function IsRunning(ProcessID, oWMISrvc) ' boolean
> Dim sQry
>  sQry = "SELECT * FROM Win32_Process WHERE ProcessID = '" _
>       & ProcessID & "'"
>  IsRunning = (oWMISrvc.ExecQuery(sqry).count > 0)
> end function

> (Watch for line wrapping in posting.)
> _____________________
> Tom Lavedas


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google