Run a .vbs on a remote PC



Hi,



I'm new to VBscript and trying to get MyProgram.vbs(which lists all software
installed on a PC) to run on a remote PC but it wont do anything....the
program runs fine on my local machine,and it runs fine on the remote PC if I
run it from there, but it wont work when I try remotely, any help would be
much appreciated...here's the code I have for running a remote program:


'==========================
'Remote.vbs
'==========================

Const OverwriteExisting = TRUE

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\Scripts\MyProgram.vbs", _
"\\remoteIPAddress\C$\Scripts\",OverWriteExisting

strComputer = "remoteIPAddress"

Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2:Win32_Process")



Error = objWMIService.Create("c:\scripts\MyProgram.vbs", null,
null,intProcessID)

If Error = 0 Then
MsgBox (strProcess & " was started with a process ID of " & intProcessID &
".")

Else
MsgBox (strProcess & " could not be started due to error " & _
errReturn & ".")

End If

================================= So it does copy the program to c:\Scripts
of the remote PC but it wont run the program...I do believe that it kicks of
a wscript process in the process list on task manager. Please help
.



Relevant Pages

  • Re: Remote desktop questions.
    ... I have setup a remote desktop connection from a Client to another succefully. ... If i logon with Domain admin, i have a new Desktop on Remote PC, which i dont wont. ... Al Jarvi (MS-MVP Windows Networking) ...
    (microsoft.public.windowsxp.work_remotely)
  • how to reinstall services
    ... after recintly installing a bluetooth adapter the service routing and remote ... access is damaged and or wont start up. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Run a .vbs on a remote PC
    ... Peter I don't really understand...I had thought that it would run as a hidden ... There are no prompts or no UI that the remote user would see so there ... >> I'm new to VBscript and trying to get MyProgram.vbs(which lists all software ... >> run it from there, but it wont work when I try remotely, any help would be ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Run a .vbs on a remote PC
    ... > I'm new to VBscript and trying to get MyProgram.vbs(which lists all ... > fine on the remote PC if I run it from there, but it wont work when I ... Microsoft MVP Scripting ...
    (microsoft.public.win32.programmer.wmi)
  • RE: Remote Web Workplace
    ... lists that are displayed for remote control access. ... > the RWW and the list of server name. ...
    (microsoft.public.windows.server.sbs)

Loading