
關(guān)于XP與WIN7批處理命令的區(qū)別修改請WIN7大神幫看下下面這段命令,原來是可以在XP下正常運行的,請問到WIN7后哪些指命要有所改變?語法上有什么不同,多謝指點!
nclick="copycode($('code0'));">復(fù)制代碼
- :修改
- cls
- echo.!a0!!a0!通用IP設(shè)置(計算機名、網(wǎng)關(guān)、掩碼、DNS、工作組)
- if %唯ip%==1 goto :xgip
- echo 正在更改計算機名請稍后...... 改名為:%computername%
- reg add HKLMSYSTEMCurrentControlSetControlComputerNameActiveComputerName /v ComputerName /t REG_SZ /d %computername% /f > nul
- reg add HKLMSYSTEMCurrentControlSetControlComputerNameComputerName /v ComputerName /t REG_SZ /d %computername% /f > nul
- reg add HKLMSYSTEMCurrentControlSetServicesTcpipParameters /v Hostname /t REG_SZ /d %computername% /f > nul
- reg add HKLMSYSTEMCurrentControlSetServicesTcpipParameters /v NV Hostname /t REG_SZ /d %computername% /f > nul
- echo.!a0!!a0!設(shè)置網(wǎng)關(guān)
- netsh interface ip set address name=本地連接 gateway=%wy%%wg% gwmetric=0
- :xgip
- echo.!a0!!a0! 設(shè)置本機IP和掩碼
- netsh interface ip set address name=本地連接 source=static addr=%wy%%ip%mask=%wym%
- if %唯ip%==1 goto :good
- echo.!a0!!a0!設(shè)置主DNS
- netsh interface ip set dns name=本地連接 source=static addr=%wdns%
- echo.!a0!!a0!設(shè)置備用DNS
- netsh interface ip add dns 本地連接 %wbdns%
- echo.!a0!!a0!入工作組 工作組為:%gzz%, 請稍候.......
- wmic computersystem where Name=%computername% call JoinDomainOrWorkgroup Name=%gzz%
- echo.!a0!!a0!修改計算機描述
- reg add HKEY_LOCAL_MACHINESystemCurrentControlSetServiceslanmanserverParameters /v srvcomment /t reg_sz /d %describe% /f
- net config server /SRVCOMMENT:%describe%
- :改用戶名
- wmic useraccount where name='%username%' call Rename %describe%
- :網(wǎng)絡(luò)映射
- if %不映射%==1 echo.!a0!!a0!您已關(guān)閉網(wǎng)絡(luò)映射功能,所以無法映射資源盤!& goto :good
- echo.!a0!!a0!特別提示:由于學校內(nèi)網(wǎng)服務(wù)器映射盤符為L~V盤,如果您的硬件設(shè)備占用了這些盤符會造成映射失敗!
- echo.!a0!請回車確定開始設(shè)置網(wǎng)絡(luò)映射權(quán)限!
- :: 刪除原有映射
- cls
- for %%1 in ( L M N O P Q R S T U V ) do net use %%1: /delete
- regini MP2-on.ini
- cls
- echo.!a0!!a0!讀取權(quán)限
- reg delete HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerMountPoints2 /f
- for/l %%i in (0,1,23) do(
- if !gxpf:~%%i,1!== goto :改盤名
- set pfm=!gxpf:~%%i,1!
- for %%1 in (!pfm!) do (
- echo.正在映射%%1盤……
- if !wp%%1!== ( echo.共享盤%%1為空,無法映射!) else (
- reg add HKEY_CURRENT_USERNetwork!pfm! /v RemotePath /t REG_SZ /d %wy%%whwq%!wp%%1! /f
- reg add HKEY_CURRENT_USERNetwork!pfm! /v UserName /t REG_SZ /d %COMPUTERNAME%%wlyh% /f
- reg add HKEY_CURRENT_USERNetwork!pfm! /v ProviderName /t REG_SZ /d Microsoft Windows Network /f
- reg add HKEY_CURRENT_USERNetwork!pfm! /v ProviderType /t REG_dword /d 131072 /f
- reg add HKEY_CURRENT_USERNetwork!pfm! /v ConnectionType /t REG_dword /d 1 /f
- reg add HKEY_CURRENT_USERNetwork!pfm! /v DeferFlags /t REG_dword /d 1 /f
- reg add HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerMountPoints2##%wy%%whwq%#!wp%%1! /v _LabelFromReg /t REG_SZ /d !wp%%1! /f
- reg add HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerMountPoints2##%wy%%whwq%#!wp%%1! /v baseClass /t REG_SZ /d Drive /f
- reg add HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerMountPoints2##%wy%%whwq%#!wp%%1! /v _CommentFromDesktopINI /t REG_SZ /d /f
- reg add HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerMountPoints2##%wy%%whwq%#!wp%%1! /v _LabelFromDesktopINI /t REG_SZ /d /f
- )>nul
- )
- set pfs=%%i
- )
- :改盤名
- echo.!a0!!a0!磁盤改名
- label c:系統(tǒng)
- label d:軟件
- :good
- echo 改極域登入名
- reg add HKEY_USERSS-1-5-21-117609710-507921405-1801674531-500SoftwareTopDomaine-Learning Class V6.0StudentMainPreferences /v ConnectName /t REG_SZ /d %computername% /f
- reg add HKEY_CURRENT_USERSoftwareTopDomaine-Learning Class V6.0StudentMainPreferences /v ConnectName /t REG_SZ /d %computername% /f
- reg add HKEY_USERS.DEFAULTSoftwareTopDomaine-Learning Class V6.0StudentMainPreferences /v ConnectName /t REG_SZ /d %computername% /f
- reg add HKEY_USERSS-1-5-21-1343024091-1383384898-1801674531-500SoftwareTopDomaine-Learning Class V6.0StudentMainPreferences /v ConnectName /t REG_SZ /d %computername% /f
- echo 關(guān)閉注冊表關(guān)鍵區(qū)
- regini MP2-off.ini
- call 自動關(guān)機及共享.bat
- :end
- echo.!a0!設(shè)置完成,工作組生效需要注銷計算機系統(tǒng)!!a0!按任意鍵進行注銷,如需手動注銷或別的請選擇。
- echo.------------------------------退出系統(tǒng) -----------------------------------------
- echo.!a0!!a0!1重新啟動計算機!a0!!a0!2注銷當前用戶!a0!!a0!3稍后手動關(guān)機!a0!!a0!4回到開始重新設(shè)置!a0!!a0!
- set p=2
- set /p p=請選擇:
- if %p%==1 shutdown -r -f -t 0
- if %p%==2 shutdown -f -f -t 0
- if %p%==3 goto :eof
- if %p%==4 goto :初始化
- goto :end

