I often make a fresh system to play around with, but every time after finishing it I still have to set up a whole series of commonly used system items and services, so I made a handy little batch file. This is my first time posting, so please go easy on me. The batch file may be pretty messy, so please help point out what to improve!
[ Last edited by w450579598 on 2009-2-12 at 12:38 ]
@echo off
title tian's little tool
color 0a
:start
echo 1.Disable all unnecessary system services
echo 2.Remove the shortcut arrow from desktop icons
echo 3.Change the IE homepage
echo 4.Change LAN IP and DNS address
echo 5.Disable IIS FTP SMTP WWWA services
echo 100.Exit
set /p zdt=Enter:
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 Choose www.hao123.com press 1
echo Choose www.baidu.com press 2
echo Choose www.google.com press 3
set /p x=Enter the number of the website you want:
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 To change the IP address to 192.168.1.2 choose 2
echo To change the IP address to 192.168.1.3 choose 3
echo To change the IP address to 192.168.1.4 choose 4
set /p d=Please enter:
if "%d%" equ "2" netsh interface ip set address "Local Area Connection" static 192.168.1.6 255.255.255.0 && netsh interface ip set dns "Local Area Connection" static 219.150.32.132 && netsh interface ip add dns "Local Area Connection" 219.146.0.130 index=2
if "%d%" equ "3" netsh interface ip set address "Local Area Connection" static 192.168.1.7 255.255.255.0 && netsh interface ip set dns "Local Area Connection" static 219.150.32.132 && netsh interface ip add dns "Local Area Connection" 219.146.0.130 index=2
if "%d%" equ "4" netsh interface ip set address "Local Area Connection" static 192.168.1.8 255.255.255.0 && netsh interface ip set dns "Local Area Connection" static 219.150.32.132 && netsh interface ip add dns "Local Area Connection" 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 ]

