China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-08 01:41
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Question about using the for command View 656 Replies 4
Original Poster Posted 2008-04-10 23:22 ·  中国 四川 成都 锦江区 电信
初级用户
★★
Credits 154
Posts 67
Joined 2007-12-02 16:45
18-year member
UID 104465
Gender Male
Status Offline
echo c:\>%temp%/tempdu.txt
echo d:\>>%temp%/tempdu.txt
echo e:\>>%temp%/tempdu.txt
echo f:\>>%temp%/tempdu.txt
for /F %%i in (%temp%/tempdu.txt) do attrib -s -r -s -h "%%i*.*
for /F %%i in (%temp%/tempdu.txt) do del /f /q %iautorun.inf

Because the computer got infected with a batch file virus, I want to delete it. It has infected several of my LAN machines, so I'm asking everyone for help.

Especially with the FOR command: %%i is defined in front, but after DO, if it is treated as a variable, how should it be used?

After running it, it always says ""The parameter format is incorrect""

And also the RD command.

rd "%windir%\Fonts\solasetup"

This still can't run either.
Floor 2 Posted 2008-04-10 23:51 ·  中国 广东 广州 电信
银牌会员
★★★
永远的菜鸟
Credits 1,335
Posts 574
Joined 2007-11-27 12:50
18-year member
UID 103929
Gender Male
From 广西
Status Offline
Floor 3 Posted 2008-04-10 23:54 ·  中国 广东 广州 电信
银牌会员
★★★
永远的菜鸟
Credits 1,335
Posts 574
Joined 2007-11-27 12:50
18-year member
UID 103929
Gender Male
From 广西
Status Offline
When using the rd command, it cannot delete a non-empty directory unless you use the /s /q parameters
rd /?
Floor 4 Posted 2008-04-11 00:12 ·  中国 四川 成都 锦江区 电信
初级用户
★★
Credits 154
Posts 67
Joined 2007-12-02 16:45
18-year member
UID 104465
Gender Male
Status Offline
One more question, how should I delete a folder that contains files./
Floor 5 Posted 2008-04-11 04:51 ·  中国 上海 联通
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Originally posted by lena at 2008-4-11 12:12 AM:
One more question, how should I delete a folder that contains files./

Wasn't that already answered in post #3? RD
Microsoft Windows XP
(C) Copyright 1985-2001 Microsoft Corp.

C:\test>rd /?
Removes (deletes) a directory.

RMDIR path
RD path

/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.

/Q Quiet mode, do not ask if ok to remove a directory tree with /S
Forum Jump: