Context menu shell commands %1, %L parameters

G

Guest

An earlier post I made on this subject had the middle part chopped out, which
made it make little sense.

I sometimes create entries under somewhere like:
HKEY_CLASSES_ROOT\*\shell\myapp\Command
The command would be something like: myapp.exe %1

This resulted in an explorer context menu item that would execute myapp.exe
with the currently selected filename as a parameter.

In earlier versions of Windows, the %1 would be replaced with the short
version of the filename, or you could use %L for the long filename.
In WinXP, all the parameters %0, %1, %L return the long filename, and I can't
find a way to get the short filename.

In a batch file, %~s1 does the trick - but this does not work for a context
menu command.

Is there some other parameter or easy way to get the short filename?

Before you suggest it, I have already used a command like:
short.cmd "myapp.exe" "%1"
where short.cmd contains the line
start %~s1 %~s2
This then converts the app name and the filename to short versions, and
executes as desired - but there is a command window that pops up briefly in
there (running the START command)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top