I'd just like to know if there is a way to call one doskey macro from another. I tried the following, but it doesn't work:
>doskey cleanpix=%PATH%\cleanpix.bat
>doskey cp=cleanpix
What am I doing wrong?
If there's no way to do what I'm trying to do, is there another way to define cp
to the same commands as the defintion of cleanpix
without typing all that shit out all over again? Besides CTRL+C, CTRL+V of course.
Once you create your collection of macros, save them to a file. To do so, enter DOSKEY /macros > filename. You can load them into memory by entering DOSKEY /macrofile=filename.
DOSKEY is a command for DOS, IBM OS/2, Microsoft Windows, and ReactOS that adds command history, macro functionality, and improved editing features to the command-line interpreters COMMAND.COM and cmd.exe .
I don't believe DOSKEY macros can call one another directly. You're probably better off using a quicky batch file like this. Create a file called (say) cp.cmd
and put it somewhere in your path. Its contents should be:
call %PATHTOCLEANPIX%\cleanpix.bat %*
One other note about your question - I assume that %PATH%
was an example for the question, and not the literal value you're trying to use. PATH
is a built-in environment variable that holds a list of directories where cmd
should look for executables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With