Hello,
I'm want to copy a file to many pc's, either to the desktop or Startup
folder. OS is 2k. Local admin password is the same on all, all pc's in the
same workgroup.
With the script below, I can open the desired folders and manually copy with
no problem.
I can also copy to the root folder. Something else I tried without success
was to copy to C: and create shortcut on remote desktop. I know I can do
this from a local script, but not remotely. Error messages included in
script.
Thanks
Set oFS = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
'Open a text file of computer names
Set oTS = oFS.OpenTextFile("F:\getlist\blacat.txt")
Do Until oTS.AtEndOfStream
sComputer = oTS.ReadLine
DesktopPath = WshShell.SpecialFolders("AllUsersDesktop")
WshShell.Run "\\" & sComputer & "\d$\Docume~1\Alluse~1\Desktop"
'This works
WshShell.Run "\\" & sComputer &
"\d$\Docume~1\Alluse~1\StartM~1\Programs\Startup" 'This works
oFS.CopyFile "F:\getlist\metapad.exe" ,"\\" & sComputer & "\c$\"
'This works
Wscript.echo "\\" & sComputer &"\" & DesktopPath
'This works and looks ok
'WshShell.Run "\\" & sComputer &"\" & DesktopPath
'This don't work
'Error Message - The system cannot find the path specified.
'oFS.CopyFile "F:\getlist\metapad.exe" ,"\\" & sComputer &
"\d$\Docume~1\Alluse~1\Desktop" 'This don't work
' Error Message Permission denied.
oFS.CopyFile "C:\scripts\getlist\blacat.txt" ,"\\" & sComputer & "\" &
DesktopPath This don't work
'Error Message path not found
Loop
oTS.Close