Re: How to pass short filename in context menu?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

nospam.please_at_ualberta.ca
Date: 11/26/04


Date: Fri, 26 Nov 2004 16:04:16 GMT

Now I see a reason why some don't like top posting (I don't care myself):
the "-- " at the beginning of one's sig makes all the stuff below that from
earlier posts disappear. Oh well, on with the top post:

I looked at the suggestion below, and the idea that some had of putting in a
command that could not be found by explorer - to trick it into thinking that
it may be a non-longfilename aware command, and so pass the short filename.
It turned out to be hard to find an easy way to specify a command that
explorer could not find, but CreateProcess could. And then, it didn't help
anyway, as the long filename got passed in any case.

I did find that if I used a command that was an old DOS .COM file, it did pass
the short filename. So, by renaming the .EXE that I was trying to run to
COM, I got Explorer to pass the short filename. When the .COM file is
executed, it is found to have an EXE header inside, so it still runs
correctly.

In the suggestion below, it says that %1 passes short filenames - my problem
is that it does not. If I put in anything like the following shell command:
cmd.exe /k echo %1
I get the long filename under WinXP, and the short filename in other Windows
versions.

In article <uj0ngU10EHA.1296@TK2MSFTNGP10.phx.gbl>, "Wesley Vogel"
<123WVogel955@comcast.net> wrote:
 |[[The posted tweak uses %1 as a parameter which passes short filenames to
 |cmd.exe. Changing the %1 to %l (lowercase L) passes the long filename
 |instead. ]]
 |
 |Command prompt here with long filename (WXP-Pro)
 |http://tinyurl.com/3qazt
 |
 |



Relevant Pages

  • Re: How to pass short filename in context menu?
    ... Explorer always gives reg files as shortfile names. ... This is because for merging the command is ... So explorer can't find regedit but can find notepad. ... > it may be a non-longfilename aware command, and so pass the short filename. ...
    (microsoft.public.windowsxp.general)
  • Re: Cannot delete file with name ended with a dot.
    ... on the Desktop, I could see it in Explorer fine, ... The filename si "Verbale.". ... I could'n use jolly characters in the command line because doesn't works, ... no errors on event log and no errors on ...
    (microsoft.public.windows.server.general)
  • Re: Changing Uppercase filenames into Lowercase
    ... uppercase filename to a lowercase filename, ... foundfile = f$searchcommand line. ... Based on a command procedure by Willem Grooters which was ...
    (comp.os.vms)
  • Re: Pass command line file name parameter
    ... Then the document class has a copy of the filename, ... No need to access the original command line at all. ... want the user to see all the labels as they would be printed. ... filename or any other variable of your CWinApp class. ...
    (microsoft.public.vc.mfc)
  • Re: CStdioFile::Open gives error "No error occurred"
    ... I would avoid GetErrorMessage and just use FormatMessage on the error code itself, ... presume this is *not* the filename you planned to open, so why are you using m_lpCmdLine? ... there is a serious question here as to whether or not the command line has any ... Use the debugger, it is a very useful tool. ...
    (microsoft.public.vc.mfc)