Jump to content
Sign in to follow this  

Launch .exe on remote computer

Recommended Posts



I use this code to launch a .exe on a remote computer on lan:

$strComputer = "ComputerName"
    $strProg = "Script.exe"
    Dim $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") 
    Dim $objStartup = $objWMIService.Get("Win32_ProcessStartup") 
    Dim $objConfig = $objStartup.SpawnInstance_(0)
    $objStartup.ShowWindow = 1
    Dim $objProcess = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2:Win32_process") 
    $intReturn = $objProcess.Create($strProg, $PATHCLIENT, $objStartup, $intProcessID)

But the problem is that with this method which no GUI is shown on the distant screen, the process is hidden although the variable $$objStartup.showwindow is put at 1 (SW_normal). Also if you could help me to regulate this problem, I would be grateful to you.

Bye, + Laught

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.