嵌套doskey宏 [英] Nesting doskey macros

查看:215
本文介绍了嵌套doskey宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法从另一个方法调用一个doskey宏。我尝试以下但不工作:

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

我做错了什么?

如果没有办法做我想做的,是否有另一种方法来定义 cp 到与定义相同的命令的 cleanpix 没有输入所有的一遍又一遍?除了CTRL + C,CTRL + V当然。

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.

推荐答案

我不相信DOSKEY宏可以直接调用另一个。你可能最好使用像这样的快速批处理文件。创建一个名为(say) cp.cmd 的文件,并将其放在路径中的某处。其内容应为:

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 %*

关于您的问题的另一个注释 - 我假设%PATH%问题,而不是你试图使用的字面值。 PATH 是一个内置的环境变量,其中包含 cmd 应查找可执行文件的目录列表。

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.

这篇关于嵌套doskey宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆