Computer Hope

Microsoft => Microsoft DOS => Topic started by: zavin on March 27, 2009, 03:29:27 PM

Title: RD batch file
Post by: zavin on March 27, 2009, 03:29:27 PM
 I am using the following line in a batch file, but it always ask if its  a file or a directory. How do I get around this? I need it to run unattended nightly.

RMDIR /S /Q "J:\backup"
Title: Re: RD batch file
Post by: Computer Hope Admin on March 27, 2009, 03:39:17 PM
That command should would fine with no errors, tested in Vista and XP with no issues. What may be happening is that there is a file and directory with the same name and maybe that's confusing it. Maybe try adding a backslash to the end, e.g.

rmdir /s /q j:\backup\
Title: Re: RD batch file
Post by: zavin on March 27, 2009, 03:49:04 PM
 That did it. Thanks for the help.
Title: Re: RD batch file
Post by: Computer Hope Admin on March 27, 2009, 03:50:15 PM
Glad to hear and you're welcome. :)