I have a windows 8 server on which I have created 5 users to login with credentials.
Some times I need to close all the excel process running on all the 5 users and i created a vb script for it .
My script kill only the excel process only on the user I executed the script on remaining other users excel process is still running and not get killed.
Please suggest
I am using below script:
KillprocessIE ="EXCEL.EXE"
Set ProcessList2 = GetObject("winmgmts://.").InstancesOf("win32_process")
For Each Process In ProcessList2
If Process.Name = KillProcessIE Then
Process.Terminate
End If
Next
Msgbox "All Excel Processes in your session have been terminated successfully"
Using your inputs I have modofied my code as:
Set oshell = createobject("Wscript.Shel
oshell.run"cmd.exe"
wscript.sleep 500
oshell.sendkeys "Taskkill /f /im excel.exe"""+("{Enter}")
wscript.sleep 5000
oshell.sendkeys "exit"+("{Enter}")
set oshell = nothing
WScript.Quit