View Full Version : Open Notepad on remote PC (W2K)
RickP
04-08-2003, 01:10 PM
I can start a process of notepad on the remote PC, but it doesn't show the window. I tried code to show the window, but that only showed the window on the PC I ran the script from. What I need is to run a script on one computer that opens a file with notpad on another computer. The connection is there. How would you do this? Thank you in advance.
Although you can use WMI to create a new process on a remote system, the newly created process can not interact with the desktop "the user"
strComputer = "Server1"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2:Win32_Process")
'Error = objWMIService.Create("c:\CreateTextFile.vbs", Null, Null, intProcessID)
Error = objWMIService.Create("Notepad.exe", Null, SW_NORMAL, intProcessID)
If Error = 0 Then
Wscript.Echo "Notepad was started with a process ID of " _
& intProcessID & "."
Else
Wscript.Echo "Notepad could not be started due to error " & _
Error & "."
End If
Jama
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.