Problem in adding string value to registry with .reg file - windows

I'm on win2k3 machine. I wrote a .reg file as below:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\KalleService\Parameters]
"Application"="C:\Projects\KalleService\Bin\KalleService.exe"
When double click the .reg file/say merge, it says registry modified successfully. But it has just created the Parameters key and has not created Application string value.
What could be the problem?

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\KalleService\Parameters]
"Application"="C:\\Projects\\KalleService\\Bin\\KalleService.exe"
try double slashes(\\) instead of single slash (\) in the string value.

try this:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\KalleService\Parameters]
#=" "
"Application"="\"C:\\Projects\\KalleService\\Bin\\KalleService.exe\""
or if this doesn't work
make a key manually with a value and export it (a .reg file will be created)
open that file in notepad , modify that file with your values and then again save it. and then run it.
Second way is not efficient but it will get your work done later if you do this

Related

Why double clicking opens application but does not load file?

I made an application for editing .cue files. If I use a .bat file containing
CueEditor.exe Ah.cue
line, it opens application and loads file properly; so it seems command line arguments are able to be passed properly; but double clicking on a .cue file opens application without loading file.
.reg files which include registry keys which are created by the setup program for registering the application default for .cue files are these:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.cue]
#="CueFile"
and
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CueFile]
[HKEY_CLASSES_ROOT\CueFile\Defaulticon]
#="\"C:\\Program Files\\Cue Editor\\CueEditor.ico\""
[HKEY_CLASSES_ROOT\CueFile\shell]
[HKEY_CLASSES_ROOT\CueFile\shell\open]
[HKEY_CLASSES_ROOT\CueFile\shell\open\command]
#="\"C:\\Program Files\\Cue Editor\\CueEditor.exe\" \"%1\""
What is wrong?
By the way, I use Windows XP.
At last I found answer after which I had ensured that the registry settings are appropriate. Windows passes the path as string but puts quotation marks of each side like this:
"C:\Documents and Settings\ABC\Desktop\AH.cue"
and if it is being thought that can be used as path like bare C:\Documents and Settings\ABC\Desktop\AH.cue string, it does not work. Quotation marks at the ends should have been cleaned first.

Create non-english windows explorer right-click menu

How to Add Any Application Shortcut to Windows Explorer’s Context Menu
InstallShield can create registry during installation but I can't create non-english registry successfully.
tested .reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\作業用]
[HKEY_CLASSES_ROOT\*\shell\作業用\command]
#="C:\My Menu\Menu.exe "%1""
1st line command can create
2nd line command can't create
Isn't anyway to create a non-english shortcut e.g. .reg or programming?
Use a chosen term with latin letters for the command and specify the text to display to the user as the default value of that key:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\yourword]
#="作業用"
[HKEY_CLASSES_ROOT\*\shell\yourword\command]
#="\"C:\\My Menu\\Menu.exe\" \"%1\""
Be sure to save the *.reg file with Encoding "Unicode with BOM".
Also remember to escape the values in double quotes: \ must be written as \\. Double quotes " must be written as \".
Also: If there are spaces within the path of your executable, you need to enclose the path in double quotes (escaped with \)

Adding batch script to Windows 8 context menu

I saw some other questions about this here, but still got nothing working for what I want.
I want to right click the empty space of a folder, and see a menu for executing a batch file for the current folder.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\treeFiles]
#="Execute treeFiles"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\Directory\shell\treeFiles\command]
#="C:\treeFiles.bat \"%V\""
#="C:\\treeFiles.bat -d \"\"%V\"\""
With the above, I can only see the item when I right-click a folder (not the empty space), and the batch will execute relative to it's self path, not the current folder.
Any idea how to fix?
Use this instead:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\treeFiles]
#="&Execute treeFiles"
"Icon"="%SystemRoot%\\System32\\shell32.dll,71"
[HKEY_CLASSES_ROOT\Directory\Background\shell\treeFiles\command]
#="C:\\treeFiles.bat \"%V\""

If condition in windows registry file

I want to check if a key exists in the registry, and, if so, add a new entry. As an example:
IF [HKEY_LOCAL_MACHINE\SOFTWARE\MySoftware]
[HKEY_LOCAL_MACHINE\SOFTWARE\MySoftware\]
"name"="my name"
ENDIF
I don't want to use *.bat files or any other scripting. Is there a way to do this using only a *.reg file?
Sorry, but .REG files don't support conditional operations such as "IF".
All it supports is adding and deleting keys
Microsoft Documentation on the humble reg file
https://support.microsoft.com/en-us/kb/310516

Right-click "Open" with arguments

I would like to add an entry to the Windows right-click menu that only appears when I right click on a .exe or .msi file. If the entry is selected, the exe file will be executed (like Open) but with a fixed text string as its argument.
I guess this should be possible with a registry key - any ideas how to do this?
For an .exe file, you can do the following in the registry:
Under HKEY_Classes_Root, find key .exe
Read the (Default) value (this is usually exefile)
Under HKEY_Classes_Root, find key exefile (or whatever you found in step 2)
Under exefile\shell create a new key, with a name matching what you want to see in the context menu (say, "Open With My App")
Under your new key, create a new key called command
Set the (Default) value of this key to whatever commandline you want to execute. The name of the file you clicked on can be entered using the token %1. So, for example, you could set the value to notepad.exe %1 to edit the executable in Notepad.
A similar pattern will work for other file types.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.exe\shell\Copy Address\command]
#="C:\\Windows\\CopyAddress.exe %1 "
[HKEY_CLASSES_ROOT\.msi\shell\Copy Address\command]
#="C:\\Windows\\CopyAddress.exe %1 "
Change path and menu name(CopyAddress) as per your choice.

Resources