edg21 Posted August 14, 2004 Posted August 14, 2004 In my unattended CD I have spybot S&D install & schedule it to scan every 5 days. I want to be able to determine if a certain process is running & act accordingly. My problem is this... I have several computers that cannot be interrupted (scan would cause them to fail) while a certain process is running. I want a batch file to check for a certain process.. if it see's it I would like to remove & reschedule the scan. If it is not running I would like it to run the already scheduled task. Any help or suggestions would be appreciated.
Raja Posted August 15, 2004 Posted August 15, 2004 Copy and paste the following in a .vbs file and see if this could be used for your needs. The script checks for if Notepad.exe is running or not.Simply edit the Process name as per your requirement to check if the process is running or not.CODE:strProcess = "Notepad.exe"Set objWMIService = GetObject("winmgmts:")Set colProcessList = objWMIService.ExecQuery _ ("SELECT * FROM Win32_Process where name='" & strProcess & "'")CheckProcess=(colProcessList.Count > 0)If CheckProcess = -1 Then Msgbox "Notepad is running"Else Msgbox "Notepad is NOT running"End If
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now