And I'd like not to get 8.3 names. I have found this in old history of TC: "24.02.97 Added: F4 will now pass the long name to the editor if the editor is a 32-bit program (only if full path to editor given)"
So I try to get the long name passed from TC to the script. And I see I need the full path. Still, if I specify the script in "Editor for F4" as:
Code: Select all
c:\windows\system32\wscript.exe C:\util\q.js
Code: Select all
C:\DOCUME~1\MUSTER~1\MYDOCU~1\SHORT.EXT
Note also that the executable name can be inside of " " when the spaces are part of the path. Stil,l the parameters should be able to follow the executable. Even without scripts, any program with parameter would at the moment get short names.
If you ask why I can't just enter c:\util\q.js as association: 1) script engines typically have two flavours -- one for starting scripts from gui apps and another for the one from command line environment (in this case cscript and wscript), and I have the the "command line" as active association, but I need here gui one to avoid the display of command window 2) even if I'd associate the wscript to js I'd still get the 8.3 name with the current TC.
To conclude: I believe there is a bug in processing of F4 string, where parameters are treated as the part of the name of executable.
Thank you.
P.S. The example script is:
Code: Select all
function getStart()
{
if ( s.match( /\.xls$/i ) )
return ''
return ( fso.GetFile( s ).size < 500e3 )
? "notepad ": "lister "
}
sh = WScript.CreateObject( "WScript.Shell" )
fso = WScript.CreateObject( "Scripting.FileSystemObject" )
s = WScript.Arguments( 0 )
var cmd = getStart() + '"' + s + '"'
// WScript.Echo( s );
sh.Run( cmd, 1, false )