1
我想从一个位置复制配置文件并将它们覆盖到另一个位置。以下是我的示例脚本,任何人都可以帮助我得到这个工作吗?使用VBS将多个文本文件复制到多个位置
strFileToCopy = "C:\Users\newtons\Desktop\Strat App 4 point to Pan 3.txt"
strFolder = "C:\Users\newtons\Desktop\test\"
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(strFolder) Then
objFSO.CopyFile strFileToCopy, strFolder, OverwriteExisting
Else
Wscript.Echo "Target Folder does not exist."
End If
strFileToCopy = "C:\Users\newtons\Desktop\Stat App 4 point to Pan 3.txt"
strFolder = "C:\Users\newtons\Desktop\test 2\"
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(strFolder) Then
objFSO.CopyFile strFileToCopy, strFolder, OverwriteExisting
Else
Wscript.Echo "Target Folder does not exist."
End If
Wscript.Echo "App 4 is now pointing to Pan 3"