![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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! |
My System Specs![]() |
| | #3 (permalink) |
| | 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 (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 Specs![]() |
| | #4 (permalink) |
| | 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 Specs![]() |
| | #5 (permalink) |
| | Re: Write something while app runing On Oct 31, 5:29*pm, "Marta" <I301...@newsgroup> wrote: Quote: > Thanks! It works! > _____________________ Tom Lavedas |
My System Specs![]() |
![]() |
| 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 | |||