简体   繁体   English

将进度条添加到PST复制批处理文件

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

I have a basis of a copy script (using xcopy) to copy over files for migrating over from one pc to another (xp to win7 in my case). 我有一个复制脚本(使用xcopy)复制文件的基础,以便从一台PC迁移到另一台PC(以我的情况从XP到Win7)。

Here is the code: ... 这是代码:...

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

I'd like to add a progress bar to the copying of the PST portion of the code, but I don;t know where to start with this. 我想在代码的PST部分的复制中添加进度条,但是我不知道从何开始。 Would anyone mind helping me out with a few tips on how I could start with this? 有人会介意为我提供一些有关如何开始的提示吗?

Thanks very much. 非常感谢。

Use ROBOCOPY instead of XCOPY. 使用ROBOCOPY而不是XCOPY。 See ROBOCOPY /? 看到ROBOCOPY /?

If you can't use robocopy as RGuggisberg suggested, there's the old dot notation: 如果您不能按照RGuggisberg的建议使用robocopy,则可以使用旧的点符号:

echo.|set /p=.

Each time you call it, it will put down one dot. 每次调用它时,它都会放下一个点。 For example, you could call it as follows: 例如,您可以这样称呼它:

:: 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

It can be called after any operation also. 也可以在任何操作之后调用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM