How to run a program on a specific remote computer
- by lucc
Hi, I have got this working line of code
I would like to run via VBScript a share program on a remote computer in a domain environment. The first part is ok where it is asking me to enter a computer name, but the problem is in the second part. I don't know how to run the program on the remote computer that I've entered in the first part.
computer = inputbox ("What computer do you wish to check? (Press Enter if this computer)","Computer")
set WMI = GetObject("WinMgmts://" & computer)
If computer="" then computer = "this computer"
Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("""\\compname\Share\progr.exe""")
Set objShell = nothing
After running this script, it runs the program on my computer, not on the remote computer. I want to run the program on a specific computer that I have entered from keyboard.
Please help. Thank you.