trids Posted July 15, 2004 Share Posted July 15, 2004 (edited) SCENARIOI have a script compiled to EXE, which runs in two modes as determined by a commandline parameter: ; Mode1 ; BiModal.exe -mode_1 <filename> ; ; Mode2 ; BiModal.exe -mode_2 <filename> ; $sX = "$CmdLine[0]=" & $CmdLine[0] & @LF for $nX = 1 to $CmdLine[0] $sX = $sX & "$CmdLine[" & $nX & "]=" & $CmdLine[$nX] & @LF next msgbox (0,"",$sX) exitREQUIREMENTSI want to have a separate shortcut for each mode, so that I can drag a file onto either shortcut depending on what I want to do with the file.PROBLEMI can't seem to setup a shortcut that will properly pass both the mode and the dragged filename to the script! The following values for the Target setting all just pass the filename, and the mode gets lost:"BiModal.exe" -mode_1"BiModal.exe" -mode_1 %1"BiModal.exe" "-mode_1" "%1" Any ideas?Edit: symantics, so as not confuse American cousins Edited July 15, 2004 by trids Link to comment Share on other sites More sharing options...
ezzetabi Posted July 15, 2004 Share Posted July 15, 2004 Try to activate a MSGBOX with the whole Cmdline in order to understand what happen... Link to comment Share on other sites More sharing options...
trids Posted July 15, 2004 Author Share Posted July 15, 2004 Thanks ezzetabi .. I think that's what I'm trying to do with the script I posted - unless I misunderstand you? Do you have any sample code? For the record, I don't think the the problem/solution lies in AU3 itself, but rather in how I'm building the shortcut . Link to comment Share on other sites More sharing options...
this-is-me Posted July 15, 2004 Share Posted July 15, 2004 (edited) "BiModal.exe" -mode_1 works here [Windows XP Pro] Do I understand that you want to drag a shortcut onto a shortcut and get the command line of the shortcut dragged? Edited July 15, 2004 by this-is-me Who else would I be? Link to comment Share on other sites More sharing options...
trids Posted July 15, 2004 Author Share Posted July 15, 2004 "BiModal.exe" -mode_1 works here [Windows XP Pro] Do I understand that you want to drag a shortcut onto a shortcut and get the command line of the shortcut dragged?Hmmm .. maybe it's an NT thing then (I'm on NT4 SP6 ) What I want to do is drag a file onto either shortcut, in a way that the script knows what the file was, and also onto which shortcut the file was dropped (ie: which mode it must run in). This seems like such a powerful fundamental feature, is it possible it was overlooked when they built NT4? Or am I missing something obvious? Anyone else having any success / failure? Link to comment Share on other sites More sharing options...
trids Posted July 19, 2004 Author Share Posted July 19, 2004 Here's a workaround which replaces the shortcuts with BAT files instead. The following BAT file will launch the EXE with commandline parameter -mode_1 .. AND pass the dropped filename too :REM This BAT file provides a drop-target for an EXE that REM accepts commandline parameters as well as a filename. BiModal.exe -mode_1 %1I know one should expect compromises with workarounds, but I really don't like it opening up a DOS window all the time .. so if anyone has any other ideas, I'm all ears!BTW .. am I right in understanding from the post above, by this-is-me, that a shortcut in XP will pass both the commandline parameter as well as the name of a file dropped onto it? If this is the case, can some kind XP user please post the shortcut that allows this to happen? Link to comment Share on other sites More sharing options...
sugi Posted July 20, 2004 Share Posted July 20, 2004 BiModal.exe -mode_1 %1You'll run into the next wall as soon as there's a filename containing spaces or the like. You'll need to use "%1" in the batch. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now