WAD Strange "Start" misbehavior...

May 24, 2010
855
0
Northlake, Il
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?
 
May 24, 2010
855
0
Northlake, Il
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!
 
May 24, 2010
855
0
Northlake, Il
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).
 
May 24, 2010
855
0
Northlake, Il
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.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,823
48
Albuquerque, NM
prospero.unm.edu
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!).
You could boil it down to:
Code:
Start=*Start %2 /pgm %1 %3$
subject to the value of ParameterChar or SETDOS /P.
 
May 24, 2010
855
0
Northlake, Il
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.
 

samintz

Scott Mintz
May 20, 2008
1,329
12
Solon, OH, USA
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