RE: Running script on remote machine

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,

Is the snippet you supplied below a copy of what's really in your script? If
that's the case, then a few thoughts:

1. Maybe you need to specify the full path of the script you want to run on
the other system.

2. Also, a system has to be configured properly to be able to run a .vbs
file just like a .exe/.bat/etc. I.e. I think that ".vbs" needs to be in the
System Env "PATHEXT". And there might be other stuff you have to do.

Maybe change your strWorkerScript to:

strWorkScript = "cscript C:\path\to\script\script_name.vbs"

Hope that helps!


"SuderMan" wrote:

> Hi,
>
> thanks for your answer.
> I've changed the value in registry and script is running without error but
> nothing happens, there is no effect on remote computer.
>
> Any idea what's wrong ?
>
> "NerdBoy" wrote:
>
> > Hi,
> >
> > You already know this and not have mentioned it, but:
> >
> > In order to use the WshController Object, you must enable it on each remote
> > machine you plan to run the script on. You enable it with the following
> > script (Copied from "MS Windows 2000 Scripting Guide" by MS Press)
> >
> > Const HKEY_LOCAL_MACHINE = &H80000002
> > strComputer = "RemoteCompName"
> >
> > set objRegProv = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & _
> > strComputer & "\root\default:StdRegProv")
> > strKeyPath = "SOFTWARE\Microsoft\Windows Script Host\Settings"
> > objRegProv.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, "Remote", "1"
> >
> > "SuderMan" wrote:
> >
> > > Hello !
> > >
> > > I have a script that I would like to run on several remote machines.
> > > I've tried several solutions but none of them is really working.
> > > Tools like psexec are not always working correctly.
> > >
> > > The best solution would the VBScript so in fact I need a script to run other
> > > script on several machines in a W2k domain.
> > >
> > > I've tried one like this:
> > >
> > > strRemoteComputer = "machine_name"
> > > strWorkerScript = "script_name.vbs"
> > > Set objWshController = WScript.CreateObject("WshController")
> > > Set objRemoteScript = objWshController.CreateScript(strWorkerScript,
> > > strRemoteComputer)
> > > objRemoteScript.Execute
> > >
> > > but i'm getting error: ActiveX component can't create object
> > >
> > >
> > > Did You ever see a script that is really working on remote machines ?
> > >
> > > Thank You.
.



Relevant Pages

  • Re: Remote office logon script - Long Delay
    ... Windows IP Configuration ... If I point the User's profile to a script that doesn't contain the ... I do not have WINS configured for the remote site, ... This remote server was built using connect computer script, ...
    (microsoft.public.windows.server.sbs)
  • Re: Remote office logon script - Long Delay
    ... Windows IP Configuration ... If I point the User's profile to a script that doesn't contain the ... I do not have WINS configured for the remote site, ... This remote server was built using connect computer script, ...
    (microsoft.public.windows.server.sbs)
  • RE: WMI ExecQuery from Win32_NTEventLogFile in a Workgroup environ
    ... computer from which the script is being run? ... "urkec" wrote: ... as it correctly creates the .evt files for the local ... I have a script that runs on one node and copies files from all the remote ...
    (microsoft.public.scripting.vbscript)
  • Re: Remote office logon script - Long Delay
    ... Windows IP Configuration ... If I point the User's profile to a script that doesn't contain the ... I do not have WINS configured for the remote site, ... is a GC/AD server with DNS and DHCP for it's area. ...
    (microsoft.public.windows.server.sbs)
  • Re: wshremote not running script on remote computer
    ... "The script you deploy to the remote computer must not attempt to interact ... I do want to open a command window on a remote machine, ...
    (microsoft.public.scripting.vbscript)