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-04 06:49
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » A small problem that came up while learning batch files View 872 Replies 2
Original Poster Posted 2007-04-19 22:54 ·  中国 安徽 黄山 电信
新手上路
Credits 4
Posts 1
Joined 2007-04-19 22:09
19-year member
UID 85754
Gender Male
Status Offline
I'm a newbie who just started learning batch files.. I want to write a batch file myself to clean out junk... What I wrote is as follows:

@echo off
echo 扫荡开始

rd /q /s "c:\temp"
md "c:\temp"
del /q /s "j:\J:\Temporary Internet Files\*.*"
echo 扫荡完毕
pause

After I wrote it like this and ran it, it came up with something like that file is in use... then the commands after that wouldn't run...

What's going on here? I can't figure it out... How can I make the batch file keep executing the commands below even when it encounters an error....

Please enlighten me, experts....
Floor 2 Posted 2007-04-19 23:06 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 866
Posts 415
Joined 2005-12-04 11:19
20-year member
UID 46459
Status Offline
There are too many threads like this on the forum. Search before posting.
欢迎你到批处理爱好者联盟QQ群:18023953
Floor 3 Posted 2007-04-20 00:11 ·  中国 安徽 蚌埠 电信
中级用户
★★
Credits 292
Posts 137
Joined 2007-04-03 01:59
19-year member
UID 83758
Gender Male
Status Offline


rd /q /s "c:\temp"
md "c:\temp"


Delete c:\temp first and then create c:\temp?
I don't know whether what you're deleting is
"C:\Documents and Settings\Administrator\Local Settings\Temp"
this temp? If it is, then even deleting it manually you'll find that some things can't be deleted because they're in use, let alone with a batch file
Forum Jump: