vbscript to work on remote machine

V

vbnewbie

Hello all...my first post :)
Im an Admin of 35 xp pc's...I have a .bat file on every client PC that does
an xcopy of certain files from there machines to a remote network share.

The problem im facing is im restricted from running any 3rd party tools....I
can only use what came with xp pro. Im also trying to do this with a xp pro
machine not a server.

I would like to create a vbscript(with using wmi) that can run the .bat file
on each client machine instead of me remotely connecting to them 1 by one and
running the .bat file.

I was able to get this far:
<code>
strComputer = "remote computer"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objStartup = objWMIService.Get("Win32_ProcessStartup")
Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = SHOW_WINDOW
Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")
errReturn = objProcess.Create _
("cmd.exe /c C:\backup.bat", null, objConfig, intProcessID)
<end code>

The problem is I can connect to remote pc and do things with cmd on that pc
like make directories and stuff....but it wont run the xcopy .bat file to
move files to the remote share. I verified that it starts the cmd.exe with my
credentials of admin...
Im stuck...see I cant schedule anything on the clients computers.....Im not
allowed to do that.

Maybe wmi isnt the way to go?

Was just hoping someone had an insight of something I could try

Thanks
 
A

Anteaus

You are going to have a problem here anyway, in that 35 computers cannot
connect simultaneously to one XP Pro computer. Ten is the max. Thus you'd
have to make sure that shares disconnect when not in use.

Probably the best way to launch your task would be as a scheduler job on
each computer. The batch file could include 'net use' commands to connect and
disconnect the share.

If this is a backup task, an alternative might be one ofthe many
Linux/Samba-based NAS boxes. These will typically store 200/500GB of data for
a moderate cost, and unlike Windows have no userlimit. Lacie are recommended.
 
V

vbnewbie

Anteaus,
Thank you for the reply.

Only problem im dealing with is that I cannot make any schedules tasks on
any computer Im in charge of.
Lame I know but its been disabled.

I dont have a server ...so im guessing im just stuck in the mud here.

I wish WMI would allow more then 1 hop....But I understand why it doesnt.

I almost tried PsExec but I know even that MS own sysinternals its
considered a 3rd party tool (according to the company I work for) so I cant
use it


Well if anyone has some Ideas Im all ears :)
 
A

Anteaus

vbnewbie said:
I dont have a server ...so im guessing im just stuck in the mud here.

With 35 PCs this is folly. With data scattered over 35 computers (and
presumably no backup) it's only a matter of time till a serious data loss
occurs.

Or, because people are probably creating unpassworded shares, only a matter
of time until a virus (or a disgruntled user) goes round the whole network
like a chain of dominoes. You've then got 35 PCs to flatten and reinstall.
I almost tried PsExec but I know even that MS own sysinternals its
considered a 3rd party tool (according to the company I work for) so I cant
use it

Sounds to me like it isn't so much the network that needs upgrading, it's
the firm's management that needs replacing.
 
P

Parthasarathi R

I am working on Windows XP in the batch file i want to run the a VB script file i will check it with the cscript but in xp it is not an command there is an alternative for cscript any one tell me answer.



Thanks
Parthasarathi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top