Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Clear alias parameters

Jun
770
6
After deleting a file by mistake, I read the Help and learned that alias parameters above the last one referenced get appended to the command line. So, I'm adding "echos %511 > nul %+" to the front of aliases where this shouldn't happen. Is there something shorter that I could use?
 
After deleting a file by mistake, I read the Help and learned that alias parameters above the last one referenced get appended to the command line. So, I'm adding "echos %511 > nul %+" to the front of aliases where this shouldn't happen. Is there something shorter that I could use?

How about %+ REM ? Ignoring stuff is its raison d'etre.
 
Thanks. That's better than the suggestion in the Help.

As to what I'm trying to do, see the Help for ALIAS, the paragraph ending "A convenient way to prevent unwanted command line parameters from being appended is to add a reference to %511 within the alias." I had an alias that was something like "foo %1 %+ erase bar.txt", and I mistakenly called it with two parameters.
 
Thanks. That's better than the suggestion in the Help.

As to what I'm trying to do, see the Help for ALIAS, the paragraph ending "A convenient way to prevent unwanted command line parameters from being appended is to add a reference to %511 within the alias." I had an alias that was something like "foo %1 %+ erase bar.txt", and I mistakenly called it with two parameters.
Actually, the %511 doesn't require its own command. It will have the desired effect as long as it's referenced anywhere in the alias. Using your example, "foo %1 %+ erase bar%511" would work unless you accidentally put 510 extra parameters on the command line.
 
I don't love the %511 approach, because Rex does occasionally increase things like buffer sizes, maximum number of arguments, and so on. Which is totally anal of me, since I'm never going to put that many args on a command line anyway.
 

Similar threads

Back
Top