in reply to / vs. \ in Win32 (Re: Glob on Win32: porting 5.005 to 5.6)
in thread Glob on Win32: porting 5.005 to 5.6

Even command.exe accepts / as a path separator.

If command.com accepts / then why does it fail in the last case?

C:\>type test.bat REM Hello tye! C:\>type .\test.bat REM Hello tye! C:\>type ./test.bat Invalid switch - /TEST.BAT C:\>test.bat C:\>REM Hello tye! C:\>.\test.bat C:\>REM Hello tye! C:\>./test.bat Bad command or file name C:\>

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
(tye)Re: / vs. \ in Win32 (Re: Glob on Win32: porting 5.005 to 5.6)
by tye (Sage) on Sep 04, 2001 at 19:46 UTC

    That was the type of thing I had tested before but testing it now shows command.exe not supporting it. It appears that I am correct that command.exe supports / as a directory path separator, it just doesn't always support it:

    C:\>c:/temp/cleanpath.bat Cleaning user-specific PATH: ...

    Using Microsoft software, I often boggle.

            - tye (but my friends call me "Tye")

      My testing was on 95, you are probably using NT/ME/2000 I suspect?

      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

        Actually, I meant to be discussing cmd.exe not command.(exe|com) and so Win95 doesn't count (since it doesn't have cmd.exe). But your testing matched my testing on both WinNT and Win2K: "./test.bat" and "temp/test.bat" didn't work. But "c:/temp/test.bat" did. So even cmd.exe doesn't support / as well as it supports \, but it does support / as a directory path separator in some cases.

                - tye (but my friends call me "Tye")
Re: Re: / vs. \ in Win32 (Re: Glob on Win32: porting 5.005 to 5.6)
by perchance (Monk) on Sep 05, 2001 at 10:19 UTC
    Microsoft showing what they really think of Slashdot? :)
    I get another error, not 'Bad Command...' but instead:
    '.' is not recognized as an internal or external command, operable program or batch file.
    I suppose it's because I'm on Win2K, but it does seem to give a clue as to how Windows parses the command line...

    --- perchance