Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to check vbs script in windows is running or not?

I have created a VBS script in Windows. I will run this script to get size of a file.

I made this to run for ever. (even this is my requirement).

How should I know if it is running or stopped?

------ Exact Script starts here ----- 
Set FSO = CreateObject("Scripting.FileSystemObject") 
Set FSO_check=CreateObject("Scripting.FileSystemObject") 
do while infiniteLoop=0     
----- This code is lasting for ever ----
Loop

Am i clear in my ques?

like image 283
shanmugamgsn Avatar asked Oct 21 '11 12:10

shanmugamgsn


1 Answers

How about using the commandline property? I think this need Windows XP and up.

For example:

Set objSWbemServices = GetObject ("WinMgmts:Root\Cimv2") 
Set colProcess = objSWbemServices.ExecQuery _ 
("Select * From Win32_Process where name = 'wscript.exe'") 
For Each objProcess In colProcess 
    WScript.Echo objProcess.Name, _ 
    objProcess.ProcessId, _ 
    objProcess.CommandLine 
Next
like image 123
nimizen Avatar answered Sep 28 '22 05:09

nimizen