4
3
In the standard Windows open file dialog (the dialog that comes up with the "File > Open" menu entry in Notepad, for example), I would like to be able to type a path containing slashes /. But only backslashes are accepted (I tried in both Windows XP and Windows 7). I can open c:\autoexec.bat, but if I try opening /autoexec.bat or c:/autoexec.bat, I get the error message
c:/autoexec.bat
The file name is not valid.
Windows accepts slashes as a path separator in some contexts, but sadly not in the open file dialog, at least by default.
Is there a magic registry setting, add-on program or other reasonable¹ method that would let me use slashes in the Windows file opening dialog? I am especially interested in Office 2007 running under Windows 7, but would prefer a solution that applies to all applications that use the standard dialog under XP and 7.
“Don't use Windows” is not an option.
may I ask why you want the forward slashes? you're not typing in full paths, are you? and if you are, know that with backslashes also comes the dropdown box.. no way you can type faster than making use of the dropdown completion – stijn – 2012-06-25T10:38:02.730
the only thing I can think of is that the OP is copy/pasting paths from a source using forward slashes; in that case, I would fix that source to output paths the windows style – stijn – 2012-06-25T10:43:11.287
Actually, it is a valid path separator. It was added long ago so that Windows could claim a degree of POSIX compliance. It's just that not all Windows applications support it. You can use it at the command prompt for example. See my answer for a link to a fuller explanation. You would want to use it to have scripts and applications that are more closely aligned across OS's. – Julian Knight – 2012-06-25T10:43:31.410
@stijn Yes, copy-paste was my use case. Since the applications I tend to copy-paste from use backslash for other things, whereas Windows treats the slash as an invalid character in this context, the Windows side is the only one that could be adapted. – Gilles 'SO- stop being evil' – 2012-06-25T11:23:49.517
@JulianKnight: I think it's a bit more complicated than that. Unless I'm mistaken, forward slashes are (mostly) accepted by the Win32 API, but not by the underlying kernel. For example, they don't seem to work if you use the \?\ syntax so that you can handle paths longer than 260 characters. \?\c:\windows is a valid path but \?\c:/windows doesn't seem to work. – Harry Johnston – 2012-06-26T00:22:24.550
1
@JulianKnight - just a FYI, MS doesnt have a degree of POSIX compliance, it is 100% POSIX compliant with the apporpriate MS addons. See http://en.wikipedia.org/wiki/Interix
– Keltari – 2013-02-13T03:41:45.767@Keltari: Yea, sure, I even used that once! Actually, I was referring to history and why MS added support for the / as a path delimiter. – Julian Knight – 2013-02-13T21:36:46.907
@HarryJohnston: you may be right, not really my area. These days MS support all sorts of odd things tucked away in the OS. Try
\\server.domain@SSH\...for example for some secure WebDAV magic. – Julian Knight – 2013-02-13T21:39:13.393