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
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