实例1:================================================================
@echo off
color 0aecho this is the end
实例2=================================================================
@echo off
color 5e
cls
setlocal
set pwd=0
set times=2
:check
ECHO ╭══☆→═════════════════════じ☆ve═╮
ECHO ║ ║
ECHO ║ 流氓特警 ║
ECHO ║ ║
ECHO ╰══じ☆ve════════════════════←☆══╯
echo.
echo.
set /p pwd= 输 入 密 码:
if "%pwd%"=="sunshine" goto pass
if %times%==0 goto close
exit
set /A times=%times%-1
:close
exit
:pass
cls
ECHO ╭══☆→═════════════════════じ☆ve═╮
ECHO ║ ║
ECHO ║ 流氓特警 ║
ECHO ║ ║
ECHO ╰══じ☆ve════════════════════←☆══╯
echo.
echo.
ver
goto main
color 3e
:main
cls
:check
ECHO ╭══☆→═════════════════════じ☆ve═╮
ECHO ║ ║
ECHO ║ 流氓特警 ║
ECHO ║ ║
ECHO ╰══じ☆ve════════════════════←☆══╯
echo.
echo.
echo 1.修改计算机名
echo.
echo 2.修改计算机IP
echo.
echo 3.禁止邻居属性
echo.
echo 4.恢复邻居属性
echo.
echo 5.清理系统垃圾
echo.
echo 6.显示所有磁盘(这个功能有问题,不要使用)
echo.
echo 7.重启动计算机
echo.
echo 8.退出这个程序
echo.
echo 请输入1,2,3,4,5,6,7输入其他字符,后果自负.
:restart1
set /p select=请输入:
set /a select=%select%-0
if %select%==1 goto name
if %select%==2 goto ip
if %select%==3 goto jinzhi
if %select%==4 goto huifu
if %select%==5 goto laji
if %select%==6 goto disk
if %select%==7 goto chongqi
if %select%==8 goto endend
if %select% gtr 8 goto errorselect1
:name
cls
echo -------------------------------------------------------
echo.
echo 说明
echo 本批处理是修改计算机名
echo -------------------------------------------------------
:restart5
@echo off
set /p name=请输您的计算机名:
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %name% /f
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %name% /f
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %name% /f
goto main
:ip
cls
echo -------------------------------------------------------
echo.
echo 说明
echo 本批处理是修改计算机ip
echo -------------------------------------------------------
:restart5
@echo off
set slection1=
set/p slection1=请输入IP地址:
netsh interface ip set address name="本地连接" source=static addr=%slection1% mask=255.255.255.0
set slection2=
goto main
:jinzhi
cls
echo -------------------------------------------------------
echo.
echo 说明
echo 本批处理是禁止网络邻居属性
echo -------------------------------------------------------
:restart5
@echo off
Regsvr32 /u Netshell.dll /s
goto main
:huifu
cls
echo -------------------------------------------------------
echo.
echo 说明
echo 本批处理是恢复网络邻居属性
echo -------------------------------------------------------
:restart5
@echo off
Regsvr32 Netshell.dll /s
goto main
:laji
cls
echo -------------------------------------------------------
echo.
echo 说明
echo 本批处理是清理系统垃圾
echo -------------------------------------------------------
:restart5
@echo off
echo off
echo 正在清除系统垃圾文件,请稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\recent\*.*"
del /f /s /q "%userprofile%\Local Settings\History\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\UserData\*.*"
del /f /s /q "%userprofile%\Cookies\*.*"
del /f /s /q "%userprofile%\Templates\*.*"
del /f /s /q "E:\Temporary Internet Files\*.*"
sfc /purgecache '清理系统盘无用文件
defrag %systemdrive% -b '优化预读信息
echo 清除系统LJ完成!
goto main
:disk
cls
echo -------------------------------------------------------
echo.
echo 说明
echo 本批处理是显示所有磁盘
echo -------------------------------------------------------
:restart5
@echo off
echo 这个功能暂时不好使。。。
#reg add HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoDrives /d dword:00000000 /f
goto main
:chongqi
cls
echo -------------------------------------------------------
echo.
echo 说明
echo 本批处理是重新启动计算机
echo -------------------------------------------------------
:restart5
@echo off
//关闭命令行显示
%systemroot%\system32\shutdown -r -t 0
:errorselect5
echo 选择错误,请重新选择
goto restart5
:errorselect1
echo 选择错误,请重新选择
goto restart1
:endend