RE: Running script on remote machine
- From: "NerdBoy" <NerdBoy@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 13 Jan 2006 09:43:04 -0800
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.
.
- Prev by Date: Standardize drive assignments
- Next by Date: Re: Mshsnapin (part 1): usage of mshsnapin commands.
- Previous by thread: Re: Running script on remote machine
- Next by thread: Standardize drive assignments
- Index(es):
Relevant Pages
|