Re: getarg & 8.3 filename
From: Kevin G. Rhoads (kgrhoads_at_alum.mit.edu)
Date: 09/30/04
- Next message: Steve Lionel: "Re: getarg & 8.3 filename"
- Previous message: beliavsky_at_aol.com: "free Fortran 95 for Windows (G95)"
- In reply to: Ken Plotkin: "Re: getarg & 8.3 filename"
- Next in thread: Tony Jay: "Re: getarg & 8.3 filename"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Sep 2004 13:12:42 +0000
>He's not putting the file name on the command line - he's double
>clicking it in Explorer. So he must have associated that file type
>with his program.
Yes. But beginning with Win3.1 (and perhaps earlier) whether you
drag and drop a file on executable's icon OR you double-click the
file and depend on file associations to launch the EXE, IF the EXE
is a legacy EXE, windows will provide the filename (8.3 alias in
later versions) on the command line when lauching the EXE.
It may well do that for all EXEs, not just legacy EXEs. But if
I create a DOS 16 bit real mode EXE and make an icon for it,
then dragging and dropping the file on that icon causes the
EXE to launch with the filename in the command tail. This
works in Win3.1, Win95, Win98, NT4, and WinXP. If I convert
the proggie to a QuickWin (with MS tools) or DefaultWin (with
Watcom) for a pseudo-windowed EXE for WIn3.1 (16 bit NE EXE)
it still works the same way under all those operating systems.
And if I make a 32 bit Console mode EXE, it still works that
way under those OSes.
THere may be ways using DDE, OLE or other things, but the command
tail way works fine starting with DOS EXEs and also when
they are run under true DOS -- and once I have a way to access
the command tail, I can retarget with minimal or no source changes.
(And I expect it is more readily portable to Unix/Linux/Be or
whatever than trying to exploit DDE or OLE or some other windows
specific stuff)
BUT -- I will only get the 8.3 name. Never an LFN. Since that
was symptom he described, I presumed this was the way he was
getting the filename (which may have been wrong, being an
assumption).
NOW with a modern 32 bin compiler running under
a recent Win32 OS, I can believe you could get the LFN from
the command tail.
But in file association launches, maybe
windows mistakes a modern EXE for a legacy EXE and provides
the 8.3 alias in some cases. That I've never investigated
(besides which MS would likely change the behavior with the
next release, maybe even with the next SP).
- Next message: Steve Lionel: "Re: getarg & 8.3 filename"
- Previous message: beliavsky_at_aol.com: "free Fortran 95 for Windows (G95)"
- In reply to: Ken Plotkin: "Re: getarg & 8.3 filename"
- Next in thread: Tony Jay: "Re: getarg & 8.3 filename"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|