8
> shutdown /?
> Usage: shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e | /o] [/hybrid] [/f]

The windows cmd.exe command shutdown only documents forward slash / switches, but it accepts dash - switches as well. For instance, both work:

shutdown /s /t 0
shutdown -s -t 0

When was this added and why?

Caleb Jares
  • 323
  • 2
  • 6

2 Answers2

11

Slashes are Windows's original option syntax and not all windows commands accept the dash-options.

With Dir /? you the list of the options for dir.

But with

Dir -?

you get a file not found-message (tested with Windows XP) (Same with dir -w...).

knut
  • 1,398
  • 1
  • 10
  • 16
6

I would venture that multiple escape characters are supported for switches so that users that are used to a particular escape character can still use the application from the command-line.

Bernard
  • 8,859
  • 31
  • 40