how can I delete a directory?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
caomeisanhao
Junior Coder
Posts: 28
Joined: Wed Jun 08, 2005 2:48 pm

how can I delete a directory?

Post by caomeisanhao » Mon Jul 11, 2005 9:52 am

Hi,guys
how can I delete a directory?

I just know how to delete all files in a directory,for instance:
deleteFile>C:\temp\*.*

but there is no way to delete the directory C:\temp with all it's contents ?

Thanks in advance!

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Jul 11, 2005 11:03 am

Let>RP_WAIT=1
Let>RP_WINDOWMODE=0
Run>cmd.exe /c rmdir %dirname% /s /q

If using Win95/98 replace cmd.exe with command.com
MJT Net Support
[email protected]

fightcancer
Macro Veteran
Posts: 239
Joined: Fri Apr 15, 2005 8:32 am

Post by fightcancer » Sun Aug 27, 2006 12:47 pm

Unfortunately, this command does not work for me and does not delete the directory (regardless of whether it's empty which it was).

Let>dirname=C:\test
Let>RP_WAIT=1
Let>RP_WINDOWMODE=0
wait>1
Run>cmd.exe rmdir /c %dirname% /s /q

I also tried using:

Run>cmd.exe rmdir /c C:\test /s /q

I'm using Windows XP SP2 and MS 8.0.1e trial.

Thanks,

FC

EDIT: Never mind. I found the retardation of my ways. "Run>cmd.exe rmdir /c" should be "Run>cmd.exe /c rmdir". Sorry! :)

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts