1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WAD Strange "Start" misbehavior...

Discussion in 'Support' started by mathewsdw, Jan 4, 2013.

  1. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    My usual technique for opening a directory in Windows Explorer from the command line is to enter the command "Start DirectoryName", and this works fine. For instance "Start ." to open the current directory, "Start .." to open the parent directory, "Start Z:\" to open the root directory, and even "Start ADirectoryName" to open Explorer window on the directory named "ADirectoryName". However, if the previous directory was named "A Directory Name" then`Start "A Directory Name"` would open a stand-alone TCC session. Now there is a fairly simple work around available (if short file names are enabled): `Start %@SFN["A Directory Name"]` works just fine because the short file name does not (and can not) contain any spaces. But the question is: Why is this necessary?
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,939
    Likes Received:
    30
    The first quoted sargument to START is, by default, considered a title (caption). Use START /pgm "A Directory Name".
     
  3. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,301
    Likes Received:
    39
    I use an alias
    Code:
    alias s=start /pgm
    which saves me four keystrokes and numerous annoyances.
     
  4. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Thank you, guys!!! Duh!!!! (A result of poor memory and partial blindness so I don't read the docs all that carefully anymore).

    But I have to ask, wouldn't you think that if there is only one argument supplied it would be the name of the program and not a title (for a TCC session)? (And since I supply my own titles to the various TCC sessions - the PIDs and bitness of same - I wouldn't see the title of the resulting TCC session even assuming that it's there.)

    And Charles, that's a real good idea!
     
  5. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,301
    Likes Received:
    39
    Like a lot of ... debatable design choices, that one is for CMD.EXE compatibility.
     
  6. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Thanks, Charles, now I understand. It wouldn't be polite for me to express the words here that I have for cmd.exe and the therefor the result(s) of Rex maintaining compatibility with same (although I totally understand why Rex did that and don't argue with it - the real problem is cmd.exe and not TCC).
     
  7. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Charles, your alias idea was very good, but I have a similar idea that I think is even better (at least for people with bad memory). Here's the alias that fully illustrated the idea:
    Code:
    Start=*Start %2 /pgm %1 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16 %17 %18 %19 %20
    
    Works perfectly, and I don't have to think about anything (a very good idea for me!).

    P.S. I'll note that "Start" has a lot of arguments! But I can't imagine a maximum of 20 not being more than enough for any real-world situation.
     
  8. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,301
    Likes Received:
    39
    You could boil it down to:
    Code:
    Start=*Start %2 /pgm %1 %3$
    
    subject to the value of ParameterChar or SETDOS /P.
     
  9. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Charles,

    I wasn't quite correct in a small (but very important!) way: the second (and following) arguments should really be parameter(s) passed to the program (and there really isn't any easy way to identify the argument that's supposed to be the title). So the title (I never use it!) has to go. So the (now corrected alias) should simply be:
    Code:
    Start=*Start /pgm %$
    /CODE]
    And your optimization of my original alias is a very good one!
     
    And you can, of course, define it as S*tart= so "s" will continue to work for you.
     
  10. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,187
    Likes Received:
    11
    Dan,

    Your alias is functionally equivalent to the original alias that Charles gave you. Since you pass all the arguments after your alias, you don't need to specify %$.

    Code:
    alias s*tart=*start /pgm
    
     
  11. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Scott, I learn something new every day. ; -> ) > (Smiley's are not working today.)
     

Share This Page