Nesting doskey macros
Asked Answered
E

1

9

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.

Eastereasterday answered 5/3, 2014 at 20:54 Comment(0)
P
4

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.

Pond answered 5/3, 2014 at 23:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.