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"