How to run a program on a specific remote computer
        Posted  
        
            by 
                lucc
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by lucc
        
        
        
        Published on 2013-11-01T09:14:18Z
        Indexed on 
            2013/11/01
            9:54 UTC
        
        
        Read the original article
        Hit count: 297
        
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.
© Stack Overflow or respective owner