Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Program On Remote Console

Status
Not open for further replies.

Hackster

Programmer
Mar 28, 2001
173
US
I can programmatically connect to a server, or another PC in my LAN, and run a program located on that machine. However, it will display on my console.

Is it possible to programmatically execute a program on a remote machine and have the screens for that program appear on the remote console?
 
You may do this using WMI. If your using older than W2K Operating system this will require an additional install.

For more info go here:

Here is an example using Notepad.

Code:
Dim wmgts As Object
Dim lintPID As Integer
Dim ComputerName as string

ComputerName = "localhost"

Set wmgts = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & ComputerName & "\root\cimv2:Win32_Process")

wmgts.Create "c:\windows\notepad.exe", Null, Null, lintPID

You'll also need admin rights on the target PC in order for it to work correctly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top