So not really being sure of where to start, I'll start out with what I am ultimately trying to accomplish. Given an extension (such as ".doc"), I would like to determine the the full path\name of the program used to open files with that extension ("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE", in the previous case).
A "work around" that I've been using for a while is an alias "SStart=`Start %@SFN[%1] %2 %3 %4`, but the problem with that is that the app (Microsoft Word, for example) while it "knows" what the long file name of the file is (it's displayed in the title bar), when you try to save the file to another directory (and/or slightly modified file name) the name that "comes up" in the "Save As" dialog box is the short file name that was used when "invoking" the program, and since I probably more often than not save files to an at least slightly modified new name and/or another directory entirely because the chances of my making a mistake and effectively "destroying" the "original" file are very high, I am effectively trying to copy the file name from the app's title bar (which I really can't read without the "Magnify" app because the font is so small) to the "File Name:" field of the "Save As" dialog box (same comment as for the title bar) .
There would at least seem to me to be two different possible ways of getting that information: "@Assoc" and "@FType". However, I have no clue what the results of "@Assoc" even mean ("Echo %@Assoc[.doc]" -> "Word.Document.8", and a registry search for that "phrase" came up basically nothing at all useful); and as far as "@FType" goes, I haven't yet found any character string that returns anything other than a null (empty) character string. ("echo %@ftype[PerlScriptFile]" copied from TCC docs yields "ECHO is OFF", as do all other things that I could even think of to try; and I really have no clue as to what "PerlScriptFile" either is/means - other than the fact that it has something to do with "Perl Scripting", of course.) So, how can I get what I'm looking for; or is there any way?
Just as "background", what I am really trying to accomplish is get something similar to the "Start" command to fully (i.e., not actually "passing" the short file name on to the application) work with file names containing blanks, which at the moment the "Start" command actually does not do in any shape, manner, or form; rather it just "opens up" an brand-new "empty" TCC session. (Of course, cmd.exe does an exactly equivalent thing so if you want to be "compatible" with that that is certainly "compatible" - although I can't quite resist adding that, in my opinion, being "compatible" with something that is both useless and stupid doesn't quite make sense to me - it won't work in my product because it won't work in their product - even though there's no identifiable reason why it shouldn't work in their product?) And I use blanks (a lot!) basically because of my poor vision; "ThisFileNameIsAllRunTogether" I find a lot less readable than "This File Name Is Not All Run Together".
And, after a lot of thought, I did find a "work around" for the "first half" of the problem, but I found it kind of ugly. Specifically, the alias:
SS*tart=`Start D:\DOS\SStart.btm %@Replace[%=s,/,%@SFN[%1]] %2 %3 %4 %5
%6 %7 %8 %9
But, unfortunately, even that "ugly solution" ultimately doesn't help at all because in the .btm file "SStart.btm", the only way to "start" the required application is to replace the "/" by blanks (@Replace, of course), get the long file name from the passed in short file name (@LFN), and then issue the "Start" command, which, of course, has exactly the same problem as the "Start" command issued from the command line does.
So, if I actually had the full name of the application (program) that should be "started", I could avoid using the "Start" command altogether in the batch file (by invoking the "application" directly; and I couldn't care less if the batch file immediately terminated after the app was started or "stuck around" until after the app closed, but it does the former anyway.
A "work around" that I've been using for a while is an alias "SStart=`Start %@SFN[%1] %2 %3 %4`, but the problem with that is that the app (Microsoft Word, for example) while it "knows" what the long file name of the file is (it's displayed in the title bar), when you try to save the file to another directory (and/or slightly modified file name) the name that "comes up" in the "Save As" dialog box is the short file name that was used when "invoking" the program, and since I probably more often than not save files to an at least slightly modified new name and/or another directory entirely because the chances of my making a mistake and effectively "destroying" the "original" file are very high, I am effectively trying to copy the file name from the app's title bar (which I really can't read without the "Magnify" app because the font is so small) to the "File Name:" field of the "Save As" dialog box (same comment as for the title bar) .
There would at least seem to me to be two different possible ways of getting that information: "@Assoc" and "@FType". However, I have no clue what the results of "@Assoc" even mean ("Echo %@Assoc[.doc]" -> "Word.Document.8", and a registry search for that "phrase" came up basically nothing at all useful); and as far as "@FType" goes, I haven't yet found any character string that returns anything other than a null (empty) character string. ("echo %@ftype[PerlScriptFile]" copied from TCC docs yields "ECHO is OFF", as do all other things that I could even think of to try; and I really have no clue as to what "PerlScriptFile" either is/means - other than the fact that it has something to do with "Perl Scripting", of course.) So, how can I get what I'm looking for; or is there any way?
Just as "background", what I am really trying to accomplish is get something similar to the "Start" command to fully (i.e., not actually "passing" the short file name on to the application) work with file names containing blanks, which at the moment the "Start" command actually does not do in any shape, manner, or form; rather it just "opens up" an brand-new "empty" TCC session. (Of course, cmd.exe does an exactly equivalent thing so if you want to be "compatible" with that that is certainly "compatible" - although I can't quite resist adding that, in my opinion, being "compatible" with something that is both useless and stupid doesn't quite make sense to me - it won't work in my product because it won't work in their product - even though there's no identifiable reason why it shouldn't work in their product?) And I use blanks (a lot!) basically because of my poor vision; "ThisFileNameIsAllRunTogether" I find a lot less readable than "This File Name Is Not All Run Together".
And, after a lot of thought, I did find a "work around" for the "first half" of the problem, but I found it kind of ugly. Specifically, the alias:
SS*tart=`Start D:\DOS\SStart.btm %@Replace[%=s,/,%@SFN[%1]] %2 %3 %4 %5
%6 %7 %8 %9
But, unfortunately, even that "ugly solution" ultimately doesn't help at all because in the .btm file "SStart.btm", the only way to "start" the required application is to replace the "/" by blanks (@Replace, of course), get the long file name from the passed in short file name (@LFN), and then issue the "Start" command, which, of course, has exactly the same problem as the "Start" command issued from the command line does.
So, if I actually had the full name of the application (program) that should be "started", I could avoid using the "Start" command altogether in the batch file (by invoking the "application" directly; and I couldn't care less if the batch file immediately terminated after the app was started or "stuck around" until after the app closed, but it does the former anyway.