我正在寻找一种方法来记录从一个 bat 脚本到一个日志文件的多个 Robocopy 运行的结果,这样就可以只在一个日志文件中查找任何错误。这可能吗?这是我的脚本:
@echo off
set /p source="Enter Source laptop name: "
@echo off
set /p username="username: "
Robocopy "\\%source%\C$\Data" "C:\Data" /e /r:1 /w:0
Robocopy "\\%source%\C$\tmpplm" "C:\tmpplm" /e /r:1 /w:0
Robocopy "\\%source%\C$\Users\%username%\Contacts" "C:\Users\%username%\Contacts" /e /r:1 /w:0
Robocopy "\\%source%\C$\Users\%username%\My Videos" "C:\Users\%username%\My Videos" /e /r:1 /w:0
Robocopy "\\%source%\C$\Users\%username%\AppData\Local\Lotus" "C:\Users\%username%\AppData\Local\Lotus" /e /r:1 /w:0
Robocopy "\\%source%\C$\Users\%username%\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations" "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations" /S /r:1 /w:0
del "C:\Users\%username%\AppData\Local\Lotus\Notes\Data\notes.ini"
@echo off
POWERSHELL.EXE -Command "Add-Type -AssemblyName System.Windows.Forms; [void] [System.Windows.Forms.MessageBox]::Show( 'Replacement script ran. Check dialog box for any errors.', 'Replacement Script', 'OK', 'Information' )"