我已经向 vbs 脚本(由第 3 方提供)添加了一个确认对话框,但我不需要单击“确定”3 次,并且希望确认提示只显示一次......在我的(有限的)知识中我做没办法做到这一点,有人可以纠正这个代码吗?
Set fso = CreateObject("Scripting.FileSystemObject")
a = "C:\Path to file 1\File 1.txt"
b = "C:\Path to file 2\File 2.txt"
RenameItem a, a & ".bak"
RenameItem b, a
RenameItem a & ".bak", b
Sub RenameItem(oldname, newname)
If fso.FileExists(oldname) Or fso.FolderExists(oldname) Then
If fso.FileExists(oldname) Then Set f = fso.GetFile(oldname)
If fso.FolderExists(oldname) Then Set f = fso.GetFolder(oldname)
f.Name = fso.GetFileName(newname)
End If
Msgbox "Files were toggled successfully" & vbNewLine & vbNewLine & "(click the ""OK"" button to exit)"
End Sub