Page 1 of 1
Using rd and del commands.
Posted: 04 Dec 2009 10:04
by Conk1
Hello, I was wondering if the latter of commands is more effective:
rd /s /q "C:\temp\"
or:
del /f /s /q "C:\temp\*.*"
rd /s /q "C:\temp\"
Does adding the del command before rd makes it anymore effective or reliable for a directory of files?
Posted: 04 Dec 2009 10:22
by avery_larry
I'm not aware of anyway that would be better. Unless you have locked files. Then using the 2 commands might get more accomplished before erroring out with a locked file or something.
otherwise the del command is redundant.
Posted: 04 Dec 2009 10:30
by Conk1
Thanks for your reply
So the only benefit of using both lines would be that the timeout would be longer?
Posted: 07 Dec 2009 19:04
by BILL Dos
You used rd /s /q "C:\temp\"
which is good if your system drive is Always C: but I perfer
doing the rd /s /q "%systemdrive%:\temp\"
That way you can have multiple drives and don't error out.
Posted: 07 Dec 2009 19:41
by Conk1
That is what I'm doing as well as other variables like %userprofile% and "localappdata% for vista.