Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To incorporate a variable into a doskey command to retrieve the variable value after executing, you can use the percent sign (%) before and after the variable name. For example, to create a doskey command to retrieve the value of a variable named "foo," you can use the following command:

doskey getfoo=echo %foo%

When you run the "getfoo" command, it will execute the "echo" command with the value of "foo" at the time the command was created, not the current value of "foo." To get the current value of "foo," you will need to update the command with the new value of "foo."