Const OverwriteExisting = True
strUserName = InputBox("Please Enter the username:", "Username")
strSourceFolder = "\\server\share\TestFolder" ' Make sure this path does NOT finish with a backslash \
strSourceFile = "\\server\share\TestFile.txt"
strTargetFolder = "\\server\share\" & strUserName & "\folder\"' Make sure this path finishes with a backslash \
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile strSourceFile , strTargetFolder, OverwriteExisting
objFSO.CopyFolder strSourceFolder , strTargetFolder , OverwriteExisting
|