Hacker News new | ask | show | jobs
by pjc50 2203 days ago
I've always used "start ." in cmd to open explorer. "start" is kind of useful to know since it triggers the default action for a file, e.g. "start foo.txt" opens it in Notepad or whatever your default text editor is.

"start "."" however opens another cmd window. Consistency is not a strong point.

1 comments

start uses the first quoted argument as the window title and with your example the actual argument is missing, hence you get a new console window.
Aaargh. I always forget that while UNIX strips one layer of quotes from arguments, DOS and its inheritors have no parsing and just pass the whole thing through. So you can have semantically meaningful quotes.
Speaking of weird Windows/Unix quoting complexities, the following makes a WSL equivalent of cmd's start:

  alias start="cmd.exe /c start '' ${@//&/^&}"
I don't remember where I found the details, but they're not of my invention. This may have some strange edge case failures, but works pretty well in my experience, including with spaces in filenames, but only for Windows folders, not WSL-specific ones (cmd.exe barfs, but maybe it would be possible with PowerShell).