By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,060 Members | 1,906 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,060 IT Pros & Developers. It's quick & easy.

Right-click context menu - passing short file name without path

P: 6
Hello charitable,
I have a repetitive task that requires the user to go to a command prompt, navigate to a folder (usually deep in the system), and perform a syntax scan on a file (with an in-house program), and this occurs thousands of times a year across a few users. In order to simplify this task, I have gone into the registry and created a key that allows the user to navigate to the file through the gui, right-click on the file, and then select the option "FScan", which is the name of our in-house Fortran scanning software. From there, the following code is executed:

cmd.exe /K "fscan %L"

I know I've seen a few others write about %L, or %1, trying to firgure out how to get the short file name or just the path, as it always seems to give us both the path and file name in one string.

Has anyone heard of an update that will allow us to grab just the path or just the file name?
If not, I'm looking for suggestions for a work-around.
Would it be possible to process the string in a batch file, and then put just the file name into the %L and continue with the operation (see the line below)?

cmd.exe /K "C:\BatchFiles\String2FileName.bat & fscan %L"
[execute String2FileName.bat, and then execute "fscan %L"]
Mar 12 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.