Try this:
--
Dim oFSO
Dim RFOL, LFOL
'** Objects:
Set oFSO = Wscript.CreateObject("Scripting.FileSystemObject")
'** Statements:
RFOL = "\\RemoteComputer\testfol" ' - Remote folder.
LFOL = "C:\Scripting\testfol" ' - Local folder.
'** Operation:
If oFSO.FolderExists(RFOL) Then
msgbox RFOL & " already exists."
Wscript.Quit
Else
msgbox RFOL & " does not exist. Press Ok to copy."
oFSO.CopyFolder LFOL , RFOL, True
msgbox "Copy completed"
End If
--
Regards,
Baard Schøyen
On Error Resume Next
Const ForReading = 1
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("c:\Shoretel\server.txt", ForReading)
Do Until objTextFile.AtEndOfStream
strComputer = objTextFile.Readline
If objFSO.FileExists("\\" & strcomputer & "\support\Shoretel\scmsetup.exe")
Then
Set objFolder = objFSO.GetFile("\\" & strcomputer &
"\support\Shoretel\scmsetup.exe")
Else
Set objFolder = objFSO.CreateFolder("\\" & strcomputer &
"\Support\shoretel")
objFSO.CopyFile "c:\Shoretel\scmsetup.exe" , "\\" & strcomputer &
"\support\Shoretel\", OverwriteExisting
end if
wscript.echo strcomputer & " done"
Loop
wscript.echo "all finished"
objTextFile.Close
This One Reads a file of the remote servers that you have put in a text file
(server.txt) and then it reads them one at a time. it then goes through and
checks to see if the file exist and if not then it creates the folder and
copies the file to it. it will then echo a dos screen that gives the
computer name and that it has finished its copy to that server and then when
it finishs all the servers in the text file it echos all finished.
Hope this one helps as well,
Monte(monte.b...@thyssenkrupp.com)
"Baard Schøyen" <Baard...@discussions.microsoft.com> wrote in message
news:D0422C2E-E927-45CF...@microsoft.com...