Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Write something while app runing

Reply
 
Old 4 Weeks Ago   #1 (permalink)
Marta


 
 

Write something while app runing

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


My System SpecsSystem Spec
Old 4 Weeks Ago   #2 (permalink)
Pegasus [MVP]


 
 

Re: Write something while app runing


"Marta" <I301199@newsgroup> wrote in message
news:1E46E741-A4F6-4A86-A109-0CA4824BC0C4@newsgroup
Quote:

> 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!
Write something where?


My System SpecsSystem Spec
Old 4 Weeks Ago   #3 (permalink)
Tom Lavedas


 
 

Re: Write something while app runing

On Oct 30, 6:36*am, "Marta" <I301...@newsgroup> wrote:
Quote:

> 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
My System SpecsSystem Spec
Old 4 Weeks Ago   #4 (permalink)
Marta


 
 

Re: Write something while app runing

Thanks! It works!

"Tom Lavedas" <tglbatch@newsgroup> escribió en el mensaje de
noticias:49809721-17fd-489f-b12c-9ca85178993f@newsgroup
Quote:

> On Oct 30, 6:36 am, "Marta" <I301...@newsgroup> wrote:
Quote:

>> 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
My System SpecsSystem Spec
Old 3 Weeks Ago   #5 (permalink)
Tom Lavedas


 
 

Re: Write something while app runing

On Oct 31, 5:29*pm, "Marta" <I301...@newsgroup> wrote:
Quote:

> Thanks! It works!
>
You're welcome. Thanks for the feedback. Glad I could help.
_____________________
Tom Lavedas
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Is there a problem with sound when runing SKYPE on Vista 64? Vista General
(C drive: pq service) Disk full pop up when runing setup please help!!!! Vista installation & setup
my hp pavillion dv6000 is runing slow Vista General
runing powershell script PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46