Been learning DOS for nearly half a year, and I feel it's not satisfying. I've decided to use a project to practice. Since I'm a network administrator and the internet isn't allowed at night in the internet café!! So I wrote a batch script to crack the charging system to test how much I've improved!!!
This batch script may not execute correctly for directories below the 2nd level, and it needs to be improved!!!
Also, when an error occurs during execution, it will also show success!!! See the main code below!!
setlocal EnableDelayedExpansion
@echo off & cd\ & cls &title Don't mess around!!!
echo Pubwin.exe cracking script!! 1:Crack the system
echo.
echo Test version V01 2:Restore the system
echo.
echo Producer: Chun Chun 3:Exit
echo.
set/p p= Please press a key to select
if "%p%"=="3" goto :c
if "%p%"=="1" (goto :a) else (goto :b)
:a
echo Task is being executed!!!
taskkill /im pubwin.exe /im run1l32.exe /im reclock.exe
set o=cdef
for /l %%a in (0,1,4) do (
for /f %%b in ("!o:~%%a,1!") do (
for /f %%c in ('dir/s/b "%%b:pubwin.exe"') do (
set i=%%~dpc
)
)
)
md e:windows\%date:~1,10% & copy %i%* e:windows\%date:~1,10% & cls
echo Task completed...........
ping -n 3 172.1>nul & exit
:b
copy e:windows\%date:~1,10% %i%*
rd /s /q c:windows\%date:~1,10%
echo The system has been restored
ping -n 3 172.1>nul & exit
:c
echo Exiting
ping -n 3 172.1>nul
This batch script may not execute correctly for directories below the 2nd level, and it needs to be improved!!!
Also, when an error occurs during execution, it will also show success!!! See the main code below!!
setlocal EnableDelayedExpansion
@echo off & cd\ & cls &title Don't mess around!!!
echo Pubwin.exe cracking script!! 1:Crack the system
echo.
echo Test version V01 2:Restore the system
echo.
echo Producer: Chun Chun 3:Exit
echo.
set/p p= Please press a key to select
if "%p%"=="3" goto :c
if "%p%"=="1" (goto :a) else (goto :b)
:a
echo Task is being executed!!!
taskkill /im pubwin.exe /im run1l32.exe /im reclock.exe
set o=cdef
for /l %%a in (0,1,4) do (
for /f %%b in ("!o:~%%a,1!") do (
for /f %%c in ('dir/s/b "%%b:pubwin.exe"') do (
set i=%%~dpc
)
)
)
md e:windows\%date:~1,10% & copy %i%* e:windows\%date:~1,10% & cls
echo Task completed...........
ping -n 3 172.1>nul & exit
:b
copy e:windows\%date:~1,10% %i%*
rd /s /q c:windows\%date:~1,10%
echo The system has been restored
ping -n 3 172.1>nul & exit
:c
echo Exiting
ping -n 3 172.1>nul
