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.