| |
Tnguyen81
Posts: 7
Score: 0
Joined: 8/8/2006
Status: offline
|
I'm trying to run a remote process to launch something on a remote PC. I have two questions.. 1) is there anyway to run the process without the hidden window? I think that would be nice. 2) also, in the script I am trying to launch something a little more complicated like a cmd file to run an install of an app. Is that possible? I get error codes 2 and 9 when I use the UNC path and the mapped path. I read about utilities but my company is going altiris so i dont want to try to purcahse something that we wont use later. Thanks dim strusername Dim process Dim result Dim colcomputer Dim objwmiservice strusername = Inputbox ("Enter in a PC name to find out who's logged on.") If strusername = "" Then MsgBox "Application Terminated." wscript.quit end If Set process = GetObject("winmgmts:{impersonationLevel=impersonate }!\\" _ & strusername & "\root\cimv2:Win32_Process") result = process.Create("notepad.exe",Null,Null,processid) WScript.Echo result Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strusername & "\root\cimv2") Set colcomputer = objWMIService.ExecQuery _ ("Select * from Win32_ComputerSystem") For Each objComputer in colComputer Wscript.Echo "User Name = " & objComputer.UserName _ & vbNewLine & "Computer Name = " & objComputer.Name WScript.Echo objComputer.UserName Next
|
|