中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-04 07:57
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » A small problem that came up while learning batch files
Printable Version  873 / 2
Floor1 ask0199 Posted 2007-04-19 22:54
新手上路 Posts 1 Credits 4
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....
Floor2 htysm Posted 2007-04-19 23:06
高级用户 Posts 415 Credits 866
There are too many threads like this on the forum. Search before posting.
Floor3 bw070 Posted 2007-04-20 00:11
中级用户 Posts 137 Credits 292


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
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023