每月一次,我会重新拍摄30台机器。新员工转移到其他机器,我必须将他们的数据移动到服务器,然后在我设置新机器后将其拉回。我可以使用我创建的菜单为一台机器执行此操作
我想来回复制这些数据
桌面我的文档收藏夹和其他一些文件(我现在可以批处理,但对于一台机器)
是否可以使用计算机列表和用户.txt文件,这样就可以进行0次交互?
Windows环境,这是代码
@ECHO OFF
@echo off
@ECHO
color 4E
CLS
@ECHO OFF
:MENU
@ECHO
@ECHO ***************************************************************
@ECHO **************************January 2012*************************
@ECHO ********************* PCT T00L Windows XP *********************
@ECHO *****************DO NOT USE ON CLASS MACHINES******************
@ECHO ***************************************************************
ECHO 1 Backup Profile 20 cCleaner
ECHO 2 Import Profile 21 aTf
ECHO 3 ... 22 Control Panel
ECHO 4 Soft Clean PC 23 Remove Flash
ECHO 5 ... 24 Remove Lotus Notes
ECHO 6 ... 25 ...
ECHO 7 ... 26 ...
ECHO 8 ... 27 ...
ECHO 9 ... 28 ...
ECHO 10 ... 00 ...
ECHO.
SET /P M=Choose Option or press 0 to Exit, then press ENTER:
IF %M%==00 GOTO EXIT
IF %M%==1 GOTO Backup Profile
IF %M%==2 GOTO Import Profile
IF %M%==3 GOTO Decrypt
IF %M%==4 GOTO SoftClean
IF %M%==5 GOTO Finish
IF %M%==6 GOTO DLP
IF %M%==7 GOTO
IF %M%==8 GOTO
IF %M%==9 GOTO
IF %M%==10 GOTO
IF %M%==11 GOTO
IF %M%==12 GOTO
IF %M%==13 GOTO
IF %M%==14 GOTO
IF %M%==15 GOTO
IF %M%==16 GOTO
IF %M%==17 GOTO
IF %M%==18 GOTO
IF %M%==19 GOTO
IF %M%==20 GOTO cCleaner
IF %M%==21 GOTO aTf
IF %M%==22 GOTO Control Panel
IF %M%==23 GOTO Flash
IF %M%==24 GOTO LnotesRemove
IF %M%==25 GOTO
IF %M%==26 GOTO
IF %M%==27 GOTO
IF %M%==28 GOTO
IF %M%==29 GOTO
IF %M%==30 GOTO
:Backup Profile
REG export HKEY_CURRENT_USER\Network "C:\Documents and Settings\%username%\desktop\network.reg"
REG export HKEY_CURRENT_USER\Printers "C:\Documents and Settings\%username%\desktop\printers.reg"
ECHO Printers and Network drives have been save to the desktop....Please press enter to continue backup
pause
MD "\\nw974724\steve\%username%\Root"
MD "\\nw974724\steve\%username%\Program Files\Lotus\Notes\Data"
MD "\\nw974724\steve\%username%\Documents and Settings\%username%\Desktop"
MD "\\nw974724\steve\%username%\Documents and Settings\%username%\My Documents"
MD "\\nw974724\steve\%username%\Documents and Settings\%username%\Favorites"
MD "\\nw974724\steve\%username%\Documents and Settings\%username%\SametimeMeetings"
MD "\\nw974724\steve\%username%\Documents and Settings\%username%\SametimeTranscripts"
XCOPY c:\ \\nw974724\steve\%username%\root /e /s /y /EXCLUDE:\\nw974724\steve\folders.txt
xcopy "C:\Documents and Settings\%username%\*.*" "\\nw974724\steve\%username%\Documents and Settings\%username%\*.*"
copy "C:\Program Files\Lotus\Notes\Data\names.nsf" "\\nw974724\steve\%username%\Program Files\Lotus\Notes\Data\names.nsf"
copy "C:\Program Files\Lotus\Notes\Data\headline.nsf" "\\nw974724\steve\%username%\Program Files\Lotus\Notes\Data\headline.nsf"
copy "C:\Program Files\Lotus\Notes\Data\%username%.id" "\\nw974724\steve\%username%\Program Files\Lotus\Notes\Data\%username%.id"
copy "C:\Program Files\Lotus\Notes\Data\user.dic" "\\nw974724\steve\%username%\Program Files\Lotus\Notes\Data\user.dic"
copy "C:\Program Files\Lotus\Notes\Data\desktop6.ndk" "\\nw974724\steve\%username%\Program Files\Lotus\Notes\Data\desktop6.ndk"
xcopy /s /h /x /f /r /k /i /e "C:\Program Files\PASSPORT\Sessions" "\\nw974724\steve\%username%\Program Files\PASSPORT\Sessions"
xcopy /y /s /h /x /f /r /k /i /e "C:\Documents and Settings\%username%\Desktop" "\\nw974724\steve\%username%\Documents and Settings\%username%\Desktop"
xcopy /y /s /h /x /f /r /k /i /e "C:\Documents and Settings\%username%\My Documents" "\\nw974724\steve\%username%\Documents and Settings\%username%\My Documents"
xcopy /y /s /h /x /f /r /k /i /e "C:\Documents and Settings\%username%\Favorites" "\\nw974724\steve\%username%\Documents and Settings\%username%\Favorites"
xcopy /y /s /h /x /f /r /k /i /e "C:\Documents and Settings\%username%\SametimeMeetings" "\\nw974724\steve\%username%\Documents and Settings\%username%\SametimeMeetings"
xcopy /y /s /h /x /f /r /k /i /e "C:\Documents and Settings\%username%\SametimeTranscripts" "\\nw974724\steve\%username%\Documents and Settings\%username%\SametimeTranscripts"
xcopy c:\*.* "\\nw974724\steve\%username%\root\"
GOTO MENU
:Import Profile
xcopy "\\nw974724\steve\%username%\root" c:\
copy "\\nw974724\steve\%username%\Program Files\Lotus\Notes\Data\names.nsf" "c:\Program Files\Lotus\Notes\Data\names.nsf"
copy "\\nw974724\steve\%username%\Program Files\Lotus\Notes\Data\headline.nsf" "c:\Program Files\Lotus\Notes\Data\headline.nsf"
copy "\\nw974724\steve\%username%\Program Files\Lotus\Notes\Data\%username%.id" "c:\Program Files\Lotus\Notes\Data\%username%.id"
copy "\\nw974724\steve\%username%\Program Files\Lotus\Notes\Data\user.dic" "c:\Program Files\Lotus\Notes\Data\user.dic"
copy "\\nw974724\steve\%username%\Program Files\Lotus\Notes\Data\desktop6.ndk" "c:\Program Files\Lotus\Notes\Data\desktop6.ndk"
xcopy /s /h /x /f /r /k /i /e ""\\nw974724\steve\%username%\Program Files\PASSPORT\Sessions" "c:\Program Files\PASSPORT\Sessions"
xcopy ""\\nw974724\steve\%username%\Documents and Settings\%username%\*.*" "c:\Documents and Settings\%username%\*.*"
xcopy /s /h /x /f /r /k /i /e "\\nw974724\steve\%username%\Documents and Settings\%username%\Desktop" "c:\Documents and Settings\%username%\Desktop"
xcopy /s /h /x /f /r /k /i /e "\\nw974724\steve\%username%\Documents and Settings\%username%\My Documents" "c:\Documents and Settings\%username%\My Documents"
xcopy /s /h /x /f /r /k /i /e "\\nw974724\steve\%username%\Documents and Settings\%username%\Favorites" "c:\Documents and Settings\%username%\Favorites"
xcopy /s /h /x /f /r /k /i /e "\\nw974724\steve\%username%\Documents and Settings\%username%\SametimeMeetings" "c:\Documents and Settings\%username%\SametimeMeetings"
xcopy /s /h /x /f /r /k /i /e "\\nw974724\steve\%username%\Documents and Settings\%username%\SametimeTranscripts" "c:\Documents and Settings\%username%\SametimeTranscripts"
GOTO MENU
:DLP
call taskkill /im edpa.exe /im wdp.exe /f
call cmd.exe
cls
GOTO MENU
:Finish
cd\
cd pstools
psexec run@classroom_date.txt -c -f -u nwie\collis20 -p dec.2011 c:\
cls
:Decrypt
:SoftClean
DEL /S /Q /F "C:\Program Files\LOTUS\NOTES\Data\Cache.NDK"
DEL /S /Q /F "C:\Documents and Settings\"%username%"\Local Settings\Temp"
DEL /S /Q /F "C:\TEMP\"
DEL /S /Q /F "C:\WINXP\Temp\"
DEL /S /Q /F "C:\Documents and Settings\%username%\Application Data\Microsoft\Office\Recent\*.*"
DEL /S /Q /F "C:\Documents and Settings\%username%\Application Data\Macromedia\Flash Player\#SharedObjects\*.*"
DEL /S /Q /F "C:\Documents and Settings\%username%\Local Settings\Temporary Internet Files\*.*"
DEL /S /Q /F "C:\Documents and Settings\%username%\Recent\*.*"
DEL /S /Q /F "C:\Documents and Settings\Administrator\Recent\*.*"
DEL /S /Q /F "C:\Documents and Settings\Administrator\local settings\temp\*.*"
DEL /S /Q /F "C:\Documents and Settings\Administrator\Application Data\Macromedia\Flash Player\#SharedObjects\*.*"
DEL /S /Q /F "C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files\*.*"
DEL /S /Q /F "C:\Documents and Settings\%USERNAME%\Application Data\Macromedia\Flash Player\macromedia.com\support\*.*"
DEL /S /Q /F "C:\Documents and Settings\%username%\Application Data\Mozilla\Firefox\Profiles\*.*"
CLS
GOTO MENU
:Control Panel
start appwiz.cpl
GOTO MENU
:cCleaner
start "\\nw974724\steve\m1n3\apps\ccleaner.exe
GOTO MENU
:aTf
start "\\nw974724\steve\m1n3\apps\ATF-Cleaner.exe
GOTO MENU
:Flash
start "\\nw974724\steve\m1n3\apps\uninstall_flash_player.exe
:LnotesRemove
ECHO Lotus Notes Data is being backed up.
xcopy "C:\Program Files\Lotus\Notes\Data\names.nsf" "c:\Documents and Settings\%username%\Desktop\Notes_Data\names.nsf"
xcopy "C:\Program Files\Lotus\Notes\Data\headline.nsf" "c:\Documents and Settings\%username%\Desktop\Notes_Data\headline.nsf"
xcopy "C:\Program Files\Lotus\Notes\Data\%username%.id" "c:\Documents and Settings\%username%\Desktop\Notes_Data\%username%.id"
xcopy "C:\Program Files\Lotus\Notes\Data\user.dic" "c:\Documents and Settings\%username%\Desktop\Notes_Data\user.dic"
xcopy "C:\Program Files\Lotus\Notes\Data\desktop6.ndk" "c:\Documents and Settings\%username%\Desktop\Notes_Data\desktop6.ndk"
ECHP Are you sure you want to remove Lotus Notes
pause
wmic
/node:%computername% product where name="Lotus Notes 8.0.2" call uninstall
/node:%computername% product where name="Lotus Connections Plug-ins" call uninstall
/node:%computername% product where name="Lotus Quickr connectors" call uninstall
exit
CLS
GOTO MENU
答案 0 :(得分:0)
您可以使用psexec
在网络中的不同计算机上运行命令。看这篇文章:https://serverfault.com/a/330049/101509。祝好运! :)