I am sorry but I am a newbie to scripting. I have created a vb script to do an uninstall of an application. I want to target computers and run the script against them and record the output to a file. I know I can put this in a logon script and let it run that way but I really need to target the machines and run it that way.

Does anyone know of a way to run a script agains another computer remotely?

0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


You could check out PSEXEC from the pstools suite from sysinternals (http://www.sysinternals.com/).

Maybe that will allow you to do what you want...
Answered 05/13/2005 by: Ilikebananas
Purple Belt

Please log in to comment
Stolen from: [link]http://cwashington.netreach.net/depo/view.asp?Index=326&ScriptType=vbscript[/link]

NameSpace = "root\cimv2"
Server = "ComputerName or IP"
UserName = "domain\user"
Password = "thePassword"

command = "calc"

Set Locator = CreateObject("WbemScripting.SWbemLocator")

If Err.Number Then
msgbox = Err.description
End If

Set Service = Locator.ConnectServer (Server, NameSpace, UserName, Password)
Service.Security_.impersonationlevel = 3

If Err.Number Then
msgbox = Err.Description & " " & """" & Server & """"
End If

Set Instance = Service.Get("Win32_Process")

If Err.Number then
msgbox = Err.Description
End If

intStatus = Instance.Create(Command, null, null, intProcessId)

If intStatus = 0 Then

If intProcessId < 0 Then
'4294967296 is 0x100000000.
intProcessId = intProcessId + 4294967296
End If

themsg = "Succeeded in executing " & Command & "." & vbCRLF
msgbox themsg & vbcrlf & "The process id is " & intProcessId & "."
msgbox "Failed to execute " & Command & ". " & Err.Description

End If
Answered 06/23/2005 by: Garrett
Orange Belt

Please log in to comment