中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-06-23 11:08
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 在重做完系统后用的批处理 查看 743 回复 2
楼 主 在重做完系统后用的批处理 发表于 2009-02-12 03:58 ·  中国 黑龙江 牡丹江 电信
新手上路
积分 8
发帖 7
注册 2008-07-20 22:52
17年会员
UID 121795
性别 男
来自 黑龙江
状态 离线
自己常常做新系统玩,但是每次做完系统又要设置等等一系列的系统常用项和服务,所以就做了个方便小批处理。我是第一次发帖请大家多多关照,批处理有可能做的很乱,请大家帮忙指点!


@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 12:38 ]
2 发表于 2009-02-12 04:16 ·  美国 惠普HP
版主
★★★★★
积分 9,023
发帖 5,017
注册 2007-05-31 19:39
19年会员
UID 89899
性别 男
状态 离线
3 方便做完系统后的批处理 发表于 2009-02-12 12:35 ·  中国 黑龙江 牡丹江 电信
新手上路
积分 8
发帖 7
注册 2008-07-20 22:52
17年会员
UID 121795
性别 男
来自 黑龙江
状态 离线

@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 ]
论坛跳转: