Results 1 to 4 of 4

Thread: Batch Blues

  1. #1
    New Lounger
    Join Date
    Feb 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Batch Blues

    Help! I'm going crazy with tried and true batch files failing now in Windows 2000 (before Win 98). Specifically, when I try to make rmdir command work under a batch file, this command fails, and yet if I launch a DOS window everything is fine. So what gives? Why are batch commands in general so squirrely under Windows 2000? Sure there's a new CMD.EXE shell and commands can be new or different. But if I can read the online helps and get DIFFERNET behavior than what I read about in the helps, I go nuts. This is progress? Thanks to anyone who comes to my rescue. Linux looks better all the time <grin>.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Batch Blues

    Is there an error message? The cmd prompt help just says:

    <pre>C:>rmdir /?
    Removes (deletes) a directory.

    RMDIR [/S] [/Q] [drive:]path
    RD [/S] [/Q] [drive:]path

    /S Removes all directories and files in the specified directory
    in addition to the directory itself. Used to remove a directory
    tree.

    /Q Quiet mode, do not ask if ok to remove a directory tree with /S</pre>

    Not much room for interpretation. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  3. #3
    New Lounger
    Join Date
    Feb 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch Blues

    Thanks for offering to help. Yes, the error message under the batch file run says that it doesn't recognize the /s switch?? If I remove the /s switch in the command line (as a diagnostic) then it can't recognize the /q switch. Here is the batch file line where I am simply deleting a directory on another hard drive in the system:

    set hd=d:back_bhc
    rmdir/s/q %hd%@bhc4

    The parser at the time of failure shows the "d:back_bhc" environment variable substitution is correct. I have renamed the directory to simply "bhc" instead of "@bhc" just in case there was syntax with "@" that I missed. No joy. I can do all these operations in a DOS command prompt window (same one that you used for the online help). The problem is that the under batch I seem to be somehow invoking another command interpretter which is different. If this is possible-- how so?

    Windows 2000 sp3

    Thanks....

  4. #4
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Des Moines, Iowa
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch Blues

    Looks to me like there should be a couple of spaces added in there:
    rmdir {space} /s {space} /q ...

    This may well be the problem *if* you transcribed it properly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •