glennda Posted February 25, 2013 Posted February 25, 2013 Does anybody have a script which checks if a process is running and does an output depending on that? I.e - is xx.exe running - no do this yes do that? I know how to do it for If Exist etc but is it possible? If *something* process.exe goto ABC else goto EFG any ideas?
Steve21 Posted February 25, 2013 Posted February 25, 2013 Do set service = GetObject ("winmgmts:") pFound = False for each Process in Service.InstancesOf ("Win32_Process") If Process.Name = "notepad.exe" then pFound = True End If next If pFound = true then Wscript.echo "Yes" end if Loop That kind of thing? Steve
glennda Posted February 25, 2013 Author Posted February 25, 2013 Erm yes - although I have just realised i could simply do - taskkill process.exe then do what i want to do anyway as it doesn't make a difference if the process is killed before what i need to do!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now