0
1
I have made a tool that adds some things to the context menu when right clicking a directory, inside the 'empty space' of a directory, or a drive. I have used this extensively in Windows XP, Vista, and 7, but now that I've upgraded to Windows 8 I'm having an issue with getting the directory that the command was launched from.
One of the things I add is "Command Prompt Here", and I have accomplished this with the following in an INF file:
HKCR,Directory\Background\Shell\CommandPromptHere\command,,,"""%SystemRoot%\System32\cmd.exe"" /c cmd /s /k ""VER && PUSHD ""%1"""""
This adds the following in a REG_EXPAND_SZ key:
"%SystemRoot%\System32\cmd.exe" /c cmd /s /k "VER && PUSHD "%1""
Since this wasn't working, (couldn't find cmd.exe), I tried replacing it with:
cmd /c cmd /s /k "VER && PUSHD "%1"
In the Windows 7, Vista and XP, "%1" gets expanded to the directory who's background was right-clicked. However, it's not working in Windows 8. Even trying to echo it back to the command line doesn't seem to be working.
I can get "%cd%" to expand when I use "ECHO %cd%", but I can't seem to use it to start the command prompt there ("PUSHD %cd%" isn't working).
Has something changed with the arguments in Windows 8? Is there some other reason it's not working? Is there another way to "Start a command prompt in the current directory" with a registry entry? Am I missing something?
The code is here: https://github.com/Ehryk/ContextMenuTools for further details or suggestions.
Why don't you just Shift + Right Click to get "Command Window Here"? And the "" at the end of your second example looks a bit odd. – ta.speot.is – 2013-02-10T10:36:01.650
>
The double quotes get rendered as single quotes in the registry key. – Ehryk – 2013-02-10T11:17:37.343
Yes but I would have expected to see something like (again, in the second example)
"%SystemRoot%\System32\cmd.exe" /c cmd /s /k "VER && PUSHD ""%1"""
– ta.speot.is – 2013-02-10T11:43:45.600