I’m trying to create a simple context menu item to open a file in my localhost server. I’m part of the way there, but what I can’t seem to get working is to have it only use the filename itself instead of the entire file and path.
[HKEY_CLASSES_ROOT\*\shell\Open as localhost]
[HKEY_CLASSES_ROOT\*\shell\Open as localhost\command]
@="firefox.exe http://localhost/%1"
that loads http://localhost/C:\wamp\www\myfile.html
when I just want http://localhost/myfile.html
The file that gets passed always contains the full path. You need to create an intermediate sort of file opener, like a batch file, that removes the full path and only uses the file name.
UPDATE
To use a batch file, create a bat with this in it:
or
Then in your HKEY, execute the batch statement
It might work to just use the batch file selector in your HKEY, too: