Why double clicking opens application but does not load file? - windows

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.

Related

question about parameter on add line to the context menu

I wrote the following lines in windows registry...
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\exefile\shell\runDOT]
#="run in DOT environment"
[HKEY_CLASSES_ROOT\exefile\shell\runDOT\command]
#="\"D:\\T00Ls\\x64\\DOT\\DOT.exe\" \"%1\""
that works like a charm!
Through parameter %1, any executable file that is selected through the context menu in explorer, is loaded by DOT.exe
To load a second file with the same name, but with a different extension, how will be the variable that I should use?
When creating context menu entries in the registry, what variables can be passed to the commands?
rmk.: I found the following doc, but not helped me.
Extending Shortcut Menus

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\""

View this file in Explorer (while open in notepad++)

I have file.txt opened in notepad++.exe
This works with all filetypes (.xlsx .txt .tab .csv .pages .scrivener you get it) on OS X:
I right click the file name using the app I'm in. (On notepad++ on windows, this would be right clicking on my file.txt file.)
A menu pops up, showing me the path to that file. For example /dropbox/work/projectA/subfolderB/file.txt
I choose a certain folder, for example the folder /projectA
That folder opens up in finder.
I want to do this on windows 7. Extra important to do it in notepad++ with .txt-files, since those are part of my GTD-system.
The question is not at all clear about what you want.
Having installed Notepad++ via the normal installer, you should be able to right-click on a file in Windows Explorer (or File Explorer) and select "Edit with Notepad++". That allows any file to be viewed with Notepad++.
The Notepad++ Run menu should contain an entry for Open containing folder that opens Windows Explorer at the folder containing the current file. This command shoul dbe in the file c:\Users\{UserName}\AppData\Roaming\Notepad++\shortcuts.xml. The shortcuts file on My Windows 7 computer contains the line
<Command name="Open containing folder" Ctrl="no" Alt="no" Shift="no" Key="0">explorer $(CURRENT_DIRECTORY)</Command>
If you need to alter the shortcuts file then do not use Notepad++, use another editor.

Creating Custom Protocol for xdebug.file_link_format and Sublime Text 2 on windows

I am trying to make it so that I can click on links outputted by xdebug and open the files that have a problem like in textmate only I am trying to do this with ST2 on windows xp.
I tried to use the SublimeProtocol plugin to accomplish this task but the format of the links it expects in order to open a file are like the following:
sblm:///C/Users/name/AppData/Roaming/Sublime%20Text%202/Packages/
and the xdebug.file_link_format is:
xdebug.file_link_format="sblm://%f?%l"
which outputs this this type of link: sblm://C:\wamp\www\busadv\parse3.php?10
so ST2's console indicates that it is unable to open the file.
Then I tried creating a custom protocol based on SO question Creating Custom Protocol
since this seemed to be in line with what I was trying to accomplish. I created a reg file with the following:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\sblm]
#="\"URL:sblm Protocol\""
"EditFlags"=hex:02,00,00,00
"URL Protocol"=""
[HKEY_CLASSES_ROOT\sblm\DefaultIcon]
#="\"C:\\Program Files\\Sublime Text 2\\sublime_text.exe\",0"
[HKEY_CLASSES_ROOT\sblm\shell]
[HKEY_CLASSES_ROOT\sblm\shell\open]
[HKEY_CLASSES_ROOT\sblm\shell\open\command]
#="\"C:\\Program Files\\Sublime Text 2\\sublime_text.exe\" -c \"%1\""
The problem is when I click the link output by xdebug a file DOES open in ST2 only file one that is originating in the directory of the browser and not where xdebug is saying its at. I tried replacing the %1 with %2 so the file would chop of the parts before C:\ but the file never opens when that replacement is used. So what are the other parameter needed in order for this to work?
UPDATE:
Added a batch file that contains the following:
#echo off
setlocal enableextensions enabledelayedexpansion
set SUBLIME=%1
set FILE=%~2
%SUBLIME% --open "%FILE:~19%"
and changed the registry to include the .bat as suggested for windows and netbeans to :
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\sblm]
#="URL:sblm Protocol Handler"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\Sublime Text\DefaultIcon]
#="\"C:\\Program Files\\Sublime Text 2\\sublime_text.exe,1\""
[HKEY_CLASSES_ROOT\sblm\shell]
[HKEY_CLASSES_ROOT\sblm\shell\open]
[HKEY_CLASSES_ROOT\sblm\shell\open\command]
#="\"C:\\Windows\\sublime.bat\" \"C:\\Program Files\\Sublime Text 2\\sublime_text.exe\" \%1\""
Also changed the xdebug.file_link_format to
xdebug.file_link_format="sblm://open/?f=%f:%l"
now ST2 still opens a file but it is from the browser directory with the link included almost but excludes C:\w.
For example xdebug link
sblm://open/?f=C:\wamp\www\busadv\parse3.php:10
the file opened in ST2 is
C:\Program Files\SRWare Iron\amp\www\busadv\parse3.php

Problem in adding string value to registry with .reg file

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

Resources