簡體   English   中英

將進度條添加到PST復制批處理文件

[英]Add a progress bar to PST copy batch file

我有一個復制腳本(使用xcopy)復制文件的基礎,以便從一台PC遷移到另一台PC(以我的情況從XP到Win7)。

這是代碼:...

xcopy /I /Y /E /F "C:\Documents and Settings\%USERNAME%\Favorites\*.*" h:\Restore\IE favorites
xcopy /I /Y /S /F "C:\Documents and Settings\%USERNAME%\Desktop" h:\restore\desktop
xcopy /I /Y /F "C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Outlook\*.nk2" h:\restore\Outlook-NK2
xcopy /I /Y /F "C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Signatures" h:\restore\Signatures
xcopy /I /Y /F "C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Office\*.acl" h:\restore\Office-AutoCorrectLists
xcopy /I /Y /F "C:\Documents and Settings\%USERNAME%\Local Settings\Application Data\Microsoft\Outlook\*.pst" h:\restore\PST1
xcopy /I /Y /F "C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Outlook\*.pst" h:\restore\PST2

xcopy /I /Y /F "C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Outlook" h:\restore\Roaming\Outlook
xcopy /I /Y /F "C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Signatures" h:\restore\Roaming\Signatures

regedit /s /e H:\restore\HKCU-RestoreODBC.reg "HKEY_CURRENT_USER\Software\ODBC\ODBC.INI"
regedit /s /e H:\restore\HKLM-RestoreODBC.reg "HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI"

regedit /s /e H:\restore\restornetwork.reg "HKEY_CURRENT_USER\Network"
regedit /s /e H:\restore\HKLM-RestoreIECert_machine.reg "HKEY_LOCAL_MACHINE\Software\Microsoft\SystemCertificates"
regedit /s /e H:\restore\HKCU-RestoreIECert_machine.reg "HKEY_CURRENT_USER\Software\Microsoft\SystemCertificates"
regedit /s /e H:\restore\RestorePrinterConnections.reg "HKEY_CURRENT_USER\Printers\Connections

我想在代碼的PST部分的復制中添加進度條,但是我不知道從何開始。 有人會介意為我提供一些有關如何開始的提示嗎?

非常感謝。

使用ROBOCOPY而不是XCOPY。 看到ROBOCOPY /?

如果您不能按照RGuggisberg的建議使用robocopy,則可以使用舊的點符號:

echo.|set /p=.

每次調用它時,它都會放下一個點。 例如,您可以這樣稱呼它:

:: hide xcopy output with > nul so dot ticker output will be visible
xcopy ... > nul
call :percentage
regedit ... > nul
call :percentage
goto :EOF

:percentage
echo.|set /p=.
goto :EOF

也可以在任何操作之后調用它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM