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

    Precision Tower 5810, Quadcore Intel Xeon E5-1630 v3, 3700 MHz
    RAM:16 GB PC6400 DDR4 SDRAM 1066MHz
    HDD: 2x ATA  ST500DM002-1BD14 500GB SATA non RAID
    Video: nVIDIA Quadro K4200 PCIe 4GB
    Audio: Recon3D PCIe, Altec Lansing ADA995 5.1 speakers
    Monitor: Dell E2011H

    7.1 pro sp1 64 bit

  • 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?