Q:

open file with localhost server

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

A:

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:
start http://localhost/%~n1%~x1

or
firefox http://localhost/%~n1%~x1

Then in your HKEY, execute the batch statement
@="firefox.exe file.bat %1"

It might work to just use the batch file selector in your HKEY, too:
@="firefox.exe http://localhost/%~n1%~x1

