Computer Hope

Microsoft => Microsoft DOS => Topic started by: mellowco on May 26, 2009, 11:37:05 PM

Title: MS-DOS RmDir Command
Post by: mellowco on May 26, 2009, 11:37:05 PM
Hello:

I have Windows XP SP3 operating system.

After a RMDIR command executes in my MS-DOS batch program, the rest of the MS-DOS commands after the RMDIR command do not execute. I don't know why.

Here is the directory structure that I have:

Folder 1\Folder 2\Folder 3
    Folder 4
        Folder 5
        Folder 6
    Folder 7
        Folder 8
        Folder 9
    Folder 10
        Folder 11

This is the RMDIR command that I coded in my MS-DOS batch program.
 
RMDIR /Q /S "C:\Folder 1\Folder 2\Folder 3"

When the RMDIR command executes, it deletes C:\Folder 1\Folder 2\Folder 3 and all the sub directories and files below it, which is what I want it to do, but then the rest of the commands after the RMDIR command in the batch file do not execute.

Does anyone know the reason for this?

Thanks for all your help!

Edward
Title: Re: MS-DOS RmDir Command
Post by: Helpmeh on May 27, 2009, 05:45:19 AM
Hello:

I have Windows XP SP3 operating system.

After a RMDIR command executes in my MS-DOS batch program, the rest of the MS-DOS commands after the RMDIR command do not execute. I don't know why.

Here is the directory structure that I have:

Folder 1\Folder 2\Folder 3
    Folder 4
        Folder 5
        Folder 6
    Folder 7
        Folder 8
        Folder 9
    Folder 10
        Folder 11

This is the RMDIR command that I coded in my MS-DOS batch program.
 
RMDIR /Q /S "C:\Folder 1\Folder 2\Folder 3"

When the RMDIR command executes, it deletes C:\Folder 1\Folder 2\Folder 3 and all the sub directories and files below it, which is what I want it to do, but then the rest of the commands after the RMDIR command in the batch file do not execute.

Does anyone know the reason for this?

Thanks for all your help!

Edward

What is the FULL code in your batch script?
Title: Re: MS-DOS RmDir Command
Post by: mellowco on May 27, 2009, 08:43:00 AM
Dear Helpmeh:

Thank you very much for your help.

After I received your reply, "What is the FULL code in the batch script", I did some more work on the problem, and I found out what was wrong.

The batch file that has the RMDIR command executes from one of the subdirectories that is being removed by the RMDIR command. When I execute my batch program from a different directory, the RMDIR command deletes properly the directory and the sub directories that I want, and then the rest of the MS-DOS commands after the RMDIR command execute as well.

Thanks again for all your help.  It was very much appreciated.  :)

With very best wishes,

Edward
Title: Re: MS-DOS RmDir Command
Post by: Helpmeh on May 27, 2009, 03:11:44 PM
Dear Helpmeh:

Thank you very much for your help.

After I received your reply, "What is the FULL code in the batch script", I did some more work on the problem, and I found out what was wrong.

The batch file that has the RMDIR command executes from one of the subdirectories that is being removed by the RMDIR command. When I execute my batch program from a different directory, the RMDIR command deletes properly the directory and the sub directories that I want, and then the rest of the MS-DOS commands after the RMDIR command execute as well.

Thanks again for all your help.  It was very much appreciated.  :)

With very best wishes,

Edward
There, if you just leave it for a little while, come back later with fresh thoughts, you're bound to solve it! Feel free to stick around to help out other members, or get more help when needed! :)