Invalid switch /s

Software & Operating Systems

Software & Operating Systems
Microsoft, Linux, Productivity software, discussion

Invalid switch /s

  • I have a batch file that  has previously worked perfectly with WinXP.
    The line - rmdir C:\filename /s now returns the following error message -
    "Invalid switch -/s"
    /s IS a valid switch when used with rmdir.
    Can anyone tell me what has gone wrong?
  • Shouldn't you be using a foldername rather than a filename?
  • Yes!  It is in fact a folder name I am using not a file name.
  • rmdir /? gives /S as a valid switch

    maybe it's case sensitive??

    Also it gives the order as RMDIR [/S] [/Q] [drive:]path so you could try that.

    Message Edited by JRosenfeld on 01-06-2005 11:35 PM

    XPS630i Quad Q6600 @ 2.4 GHz BIOS 1.0.13 FSB 1066MHz
    RAM: 3 GB PC6400 DDR2 SDRAM 800MHz
    HDD: 2x WD25 00AAJS-75VWA 250GB SATA non RAID
    DVD: Liteon DH-20A1S and HL-DT-ST DVD +-RW GSA-H73N
    Video: GeForce 8800 GT 512 MB
    Audio: Audigy 2, Altec Lansing ADA995 5.1 speakers
    Monitor: Dell 1800FP

    XP pro SP3 IE8 WMP 11

  • Fred_D

    You could give this a try if the problem is with Cmd.exe (corrupted). Rename Cmd.exe to Cmd.old in the C:\Windows\System32 folder. Then copy Cmd.exe from C:\Windows\System32\Dllcache to the C:\Windows\System32 folder. There is also a cab backup in the i386 folder (Cmd.ex_). These are the paths on my non-Dell machine.

  • Thanks to JRosenfeld and chuket for your suggestions.

    I tried the various options suggested by JRosenfeld but no joy!

    As well as in c:\windows\system32, Cmd.exe exists in c:\i386 and c:\windows\servicepackfiles\i386.  I tried copying first one then the other to c:\windows\system32 but it seems that Cmd.exe is updated (or converted back) as soon as the batch file is opened.  Consequently, the problem persists.

    This batch file is a backingup routine and has previously worked without a hitch.  I can only image that one of the more recent downloaded Windows critical updates has altered something to affect it.

    Has anyone else experienced this problem?  If so, did you find a solution?