Board logo

标题: 在重做完系统后用的批处理 [打印本页]

作者: w450579598     时间: 2009-2-12 03:58    标题: 在重做完系统后用的批处理

自己常常做新系统玩,但是每次做完系统又要设置等等一系列的系统常用项和服务,所以就做了个方便小批处理。我是第一次发帖请大家多多关照,批处理有可能做的很乱,请大家帮忙指点!
CODE:  [Copy to clipboard]
@echo off
title tian的小工具
color 0a
:start
echo 1.关闭所有不需要的系统服务
echo 2.去除桌面图标快捷方式箭头
echo 3.修改IE主页
echo 4.修改局域网IP,DNS地址
echo 5.关闭IIS FTP SMTP WWWA服务
echo 100.退出
set /p zdt=输入:

if "%zdt%" equ "1" (
   sc config tlntsvr start= disabled
   sc config termservice start= disabled
   sc config sharedaccess start= disabled
   net stop termservice
   net stop sharedaccess
   net stop tlntsvr
   pause
   cls
   goto start
) else (
cls
goto a
)
:a
if "%zdt%" equ "2" (
reg delete hkey_classes_root\lnkfile /v isshortcut /f
reg delete hkey_classes_root\piffile /v isshortcut /f
pause
cls
goto start
) else (
cls
goto b
)
:b
if "%zdt%" equ "3" (
   echo 选择 [url]www.hao123.com[/url] 请按1
   echo 选择 [url]www.baidu.com[/url] 请按2
   echo 选择 [url]www.google.com[/url] 请按3
   set /p x=输入想要的网址号:
   if "%x%" equ "1" reg add "hkcu\software\microsoft\internet Explorer\Main" /v "start page" /d [url]www.hao123.com[/url] /f
   if "%x%" equ "2" reg add "hkcu\software\microsoft\internet Explorer\Main" /v "start page" /d [url]www.baidu.com[/url] /f
   if "%x%" equ "3" reg add "hkcu\software\microsoft\internet Explorer\Main" /v "start page" /d [url]www.google.com[/url] /f
   pause
   cls
   goto start
) else (
cls
goto c
)
:c
if "%zdt%" equ "4" (
   echo 要将ip地址改为192.168.1.2 选择2
   echo 要将ip地址改为192.168.1.3 选择3
   echo 要将ip地址改为192.168.1.4 选择4
   set /p d=请输入:
            if "%d%" equ "2" netsh interface ip set address "本地连接" static 192.168.1.6 255.255.255.0 && netsh interface ip set dns "本地连接" static 219.150.32.132 && netsh interface ip add dns "本地连接" 219.146.0.130 index=2
      if "%d%" equ "3" netsh interface ip set address "本地连接" static 192.168.1.7 255.255.255.0 && netsh interface ip set dns "本地连接" static 219.150.32.132 && netsh interface ip add dns "本地连接" 219.146.0.130 index=2
      if "%d%" equ "4" netsh interface ip set address "本地连接" static 192.168.1.8 255.255.255.0 && netsh interface ip set dns "本地连接" static 219.150.32.132 && netsh interface ip add dns "本地连接" 219.146.0.130 index=2
pause & cls & goto start
) else (
cls
goto d
)
:d
if "%zdt%" equ "5"  (
   sc config iisadmin start= disabled
   sc config msftpsvc start= disabled
   sc config smtpsvc start= disabled
   sc config w3svc start= disabled
   net stop iisadmin /y
   net stop msftpsvc
   net stop smtpsvc
   net stop w3svc
   pause
   cls
   goto start
) else (
goto start & cls
)
[ Last edited by w450579598 on 2009-2-12 at 12:38 ]
作者: HAT     时间: 2009-2-12 04:16
Q: 为方便他人复制,如何给代码加code标签?
A: http://www.cn-dos.net/forum/viewthread.php?tid=43735#pid304733
参考:http://www.cn-dos.net/forum/faq.php?page=misc#1
作者: w450579598     时间: 2009-2-12 12:35    标题: 方便做完系统后的批处理

CODE:  [Copy to clipboard]
@echo off
title tian的小工具
color 0a
:start
echo 1.关闭所有不需要的系统服务
echo 2.去除桌面图标快捷方式箭头
echo 3.修改IE主页
echo 4.修改局域网IP,DNS地址
echo 5.关闭IIS FTP SMTP WWWA服务
echo 100.退出
set /p zdt=输入:

if "%zdt%" equ "1" (
   sc config tlntsvr start= disabled
   sc config termservice start= disabled
   sc config sharedaccess start= disabled
   net stop termservice
   net stop sharedaccess
   net stop tlntsvr
   pause
   cls
   goto start
) else (
cls
goto a
)
:a
if "%zdt%" equ "2" (
reg delete hkey_classes_root\lnkfile /v isshortcut /f
reg delete hkey_classes_root\piffile /v isshortcut /f
pause
cls
goto start
) else (
cls
goto b
)
:b
if "%zdt%" equ "3" (
   echo 选择 www.hao123.com 请按1
   echo 选择 www.baidu.com 请按2
   echo 选择 www.google.com 请按3
   set /p x=输入想要的网址号:
   if "%x%" equ "1" reg add "hkcu\software\microsoft\internet Explorer\Main" /v "start page" /d www.hao123.com /f
   if "%x%" equ "2" reg add "hkcu\software\microsoft\internet Explorer\Main" /v "start page" /d www.baidu.com /f
   if "%x%" equ "3" reg add "hkcu\software\microsoft\internet Explorer\Main" /v "start page" /d www.google.com /f
   pause
   cls
   goto start
) else (
cls
goto c
)
:c
if "%zdt%" equ "4" (
   echo 要将ip地址改为192.168.1.2 选择2
   echo 要将ip地址改为192.168.1.3 选择3
   echo 要将ip地址改为192.168.1.4 选择4
   set /p d=请输入:
            if "%d%" equ "2" netsh interface ip set address "本地连接" static 192.168.1.6 255.255.255.0 && netsh interface ip set dns "本地连接" static 219.150.32.132 && netsh interface ip add dns "本地连接" 219.146.0.130 index=2
      if "%d%" equ "3" netsh interface ip set address "本地连接" static 192.168.1.7 255.255.255.0 && netsh interface ip set dns "本地连接" static 219.150.32.132 && netsh interface ip add dns "本地连接" 219.146.0.130 index=2
      if "%d%" equ "4" netsh interface ip set address "本地连接" static 192.168.1.8 255.255.255.0 && netsh interface ip set dns "本地连接" static 219.150.32.132 && netsh interface ip add dns "本地连接" 219.146.0.130 index=2
pause & cls & goto start
) else (
cls
goto d
)
:d
if "%zdt%" equ "5"  (
   sc config iisadmin start= disabled
   sc config msftpsvc start= disabled
   sc config smtpsvc start= disabled
   sc config w3svc start= disabled
   net stop iisadmin /y
   net stop msftpsvc
   net stop smtpsvc
   net stop w3svc
   pause
   cls
   goto start
) else (
goto start & cls
)
[ Last edited by w450579598 on 2009-2-12 at 13:04 ]




欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) Powered by Discuz! 2.5