congahonga
23rd March 2009 10:27 UTC
Masking Quote-Sign in Reg-Entry
Hi, there
WriteRegStr HKCR "Directory\shell\CommandPrompt" "@" "MS-DOS"
WriteRegStr HKCR "Directory\shell\CommandPrompt\command" "@" "cmd.exe /k "%1""
This entry makes a convertable execute of a Command-Shell with Right-mouse click in Windows Explorer, when you select a directory name.
I can't write that to Registry with NSIS because of a masking problem in the second line
The Problem is here: "%1" --->how can I mask the Quote-Signs ?
\" doesn't work, n'either ""
Greetings Jochen Graulberger
congahonga
23rd March 2009 12:46 UTC
Found it out: Here is the solution !
WriteRegStr HKCR "Directory\shell\CommandPrompt" "@" "MS-DOS"
WriteRegStr HKCR "Directory\shell\CommandPrompt\command" "@" "cmd.exe /k cd $\"%1$\""
Anders
23rd March 2009 12:53 UTC
<Clippy>I see you are creating a dos prompt here entry, would you like some help?</Clippy>
1) Remember that cmd.exe might not be correct, you should get it from %ComSpec% if you want to support Win9x or people using 3rd party consoles.
2) When invoking cmd.exe, you might want to use cmd.exe /K cd /D "%1" or even cmd.exe /k IF 1==1 cd /D "%1"
3 "@" is not the "default" registry value in nsis
congahonga
23rd March 2009 13:37 UTC
Thank you, master...
to 3)
What is then the correct "default" registry value, you said it's not "@"