Use forward slash in file path on explorer

Page 1 of 3 123 LastLast

  1. Posts : 1
    Windows 10
       #1

    Use forward slash in file path on explorer


    I really dislike using \ in file paths because it is considerably less convenient than /. Additionally, I keep accidentally typing part of the path, using the "wrong" slash and then trying to tab complete which sends me to the search field.

    I tried searching the web for how to accomplish this, but I only found why windows has historically used \, not how to set it to use / when typing file paths.

    I have Linux muscle memory and would like to setup windows 10 to work for me instead of against me
      My Computer


  2. Posts : 818
    Windows 7
       #2

    That's not possible from CMD or Explorer.

    I have Cygwin installed, and use a POSIX shell everyday to keep my muscle memory and programming skills intact. The only difference is Cygwin file paths begin with /cygdrive/[drive letter].

    Cygwin is lightweight, so you don't have to install WSL just to enjoy having a shell and vim. Windows parsing tools suck big time, and even PowerShell regex's are weak. The only drawback is sometimes access rights don't map the way you think, due to Windows folder inheritances. But I've survived on Cygwin now for nearly two decades.
      My Computer


  3. Posts : 9,775
    Mac OS Catalina
       #3

    A Backslash has always been used in file paths vs Forward Slash for URL's. POSIX uses one form, Windows uses of course a different form.
    Backslash vs Forward Slash: Difference in Grammar, File Path
    What is the Difference Between a Relative and Absolute Path?
      My Computer


  4. Posts : 2,959
    Windows 10 Pro for the Bro
       #4

    Microsoft wanted to stand out from the crowd; they wanna be unique. Everyone uses "/"

    Today is: 5/5/2023
    Chair/Desk/Computer
    and/or
    Opposites: love/hate
    100 miles/gallon
    $30/hour


    ....Microsoft enters the chatroom: "nahhhhh. We don't wanna use / "
    Let's use this instead: C:\Windows

    YEAAAAAAA!!!!!!! hahahaha
      My Computer


  5. Posts : 1,197
    Windows 10
       #5

    Windows is POSIX and in this case UNIX complaint though you can use forward or backslash in explorer or CMD if you want.

    Unless i am understanding the thread wrong but

    Use forward slash in file path on explorer-capture.png
      My Computer


  6. Posts : 818
    Windows 7
       #6

    But / in Explorer makes Windows open a web browser instance...
      My Computer


  7. Posts : 2,197
    Windows 11 Pro 64-bit v23H2
       #7

    Malneb said:
    Windows is POSIX and in this case UNIX complaint though you can use forward or backslash in explorer or CMD if you want.

    Unless i am understanding the thread wrong but

    Use forward slash in file path on explorer-capture.png
    You misunderstand how / and \ are used in Windows (and DOS). They are not interchangeable.
    / is used for command line parameters
    \ is used for paths

    Examples

    The following have the same result:

    Code:
    C:\Windows\System32> CD /d D:\
    D:\
    Code:
    C:\Windows\System32> D:
    D:\
    Parameters for CD command:
    /d Changes the current drive as well as the current directory for a drive.

    The following does not do the same thing as the previous two examples:
    Code:
    C:\Windows\System32> CD D:\
    C:\Windows\System32>
      My Computers


  8. Posts : 1,197
    Windows 10
       #8

    The are interchangeable though.

    Just type into any explorer window or CMD window a path using forward or backslash, its an interpreted environment it knows what you are trying to do.
    Code:
    
    > cd c:/program files|Dir
    
    > cd c:/ProGram Files|Dir
    
    > cd c:\program files|Dir
    
    > cd c:\proGram Files|Dir
    
    > cd c:\PROGRAM FILES|Dir
    
    > cd c:/program files/7-zip/|Dir
    
    > cd c:/program FiLeS/7-zip\|Dir
    
    

    its all the same logic whether forward or backslash and they are interchangeable. There is only a few use case where context becomes explicit.

    - - - Updated - - -

    linuxfish said:
    I really dislike using \ in file paths because it is considerably less convenient than /. Additionally, I keep accidentally typing part of the path, using the "wrong" slash and then trying to tab complete which sends me to the search field.
    Unless i am reading the whole premise of the thread wrong then sure but this is how it reads to me and there for yes they are interchangeable. All though i did miss the part where they mentioned tabbing because i was skim reading.
      My Computer


  9. Posts : 2,197
    Windows 11 Pro 64-bit v23H2
       #9

    Malneb said:
    The are interchangeable though.

    Just type into any explorer window or CMD window a path using forward or backslash, its an interpreted environment it knows what you are trying to do.
    Code:
    
    > c:/programfiles|Dir
    
    > c:/ProGramFiles|Dir
    
    > c:\programfiles|Dir
    
    > c:\proGramFiles|Dir
    
    > c:\PROGRAMFILES|Dir
    
    > c:/program files/7-zip/|Dir
    
    > c:/program files/7-zip\|Dir
    
    

    its all the same logic whether forward or backslash and they are interchangeable. There is only a few use case where context becomes explicit.
    Believe what you want but that is a particular interpreter not something standard. Microsoft defines them as to not be interchangeable. If you know more than Microsoft then maybe you ought to tell them they are wrong.

    Technically, you could design your own parser and have logic to interpret interchanging / and \. The problem is the Windows command line doesn't have logic like that so will give an error if you use / and \ interchangeably.

    Since you are so knowledgeable about this how about post posting a link to any official reference that says that / and \ are interchangeable. Hint, don't go to microsoft.com because you won't find anything there.

    Apparently, you have never worked in computer science. If you did and tried to depend upon something non-standard you would have a lot of explaining to do to your boss.
      My Computers


  10. Posts : 1,197
    Windows 10
       #10

    ok hotshot so explain to me why the commands work then genius? in one sentence.

    - - - Updated - - -

    You also don't have to start grasping by insulting i did come in here stating that unless i am reading the thread wrong which i have stated three times now.

    If you can go ahead and explain why the commands are compatible in one sentence thanks. Seeing as you seem to want to argue with me when that was not my intention of coming in here just pointing something out.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 19:27.
Find Us




Windows 10 Forums