Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I realized that if you have a doskey macro defined and if you input that macro string as input for any set /p varname= command, later on varname contains the alias of your input.
NOT your input!
see:C:\holla\bat\t>doskey fit=dirC:\holla\bat\t>doskey xla=cls
C:\holla\bat\t>set /p llll=Macro1?
Macro1?xlaC:\holla\bat\t>echo %llll%
clsC:\holla\bat\t>set /p llll=Macro2?
Macro2?fitC:\holla\bat\t>echo %llll%
dirC:\holla\bat\t>set /p llll=Macro3?
Macro3?DoesNotExistC:\holla\bat\t>echo %llll%
DoesNotExistC:\holla\bat\t>
--
Holla.[Edited to remove some confusion]
I think this may be a result of the way set /p is handled. Set /p appears to mimic a command line, which is of course evident in your example. The reason that leads me to this idea is the way input into a set /p command becomes part of the recent command list whilst at the command line. Perhaps doskey "thinks" it's being asked to supply the information attatched to the alias because set /p appears to be the command processor.
Of course this is just speculation......
Report Offensive Follow Up For Removal
![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |