【发布时间】:2022-01-16 02:47:18
【问题描述】:
我已经编写了将文本转换为uppercase 的小脚本,如下所示,并将此文件保存为.BAT 扩展名
`converttoupper.bat`
我希望用户尝试“帮助”命令,以便他们获得有关使用以下命令的语法的帮助
help converttoupper
类似的东西
# help converttoupper
For more information on a specific command, type HELP command-name
CONVERTTOUPPER This converts the text to upper case
更新
即使我得到如下所示的东西,我也很好。我不想覆盖任何 windows 命令。
helpme converttoupper
or
helpme connectvpn
我有很多 BAT 文件,希望在每个执行时显示各自的帮助。
【问题讨论】:
-
您已经知道参数存储在
%1/%2/等中。你知道if语句是什么。你卡在哪一点?这两件事应该是你需要知道的。 -
help是一个 Windows 命令 ('C:\Windows\System32\help.exe). You'd have to hack this program to include the help for your batch file. Besides that Windows has a safeguard to protect it from changed executables, you'd have to do that on every computer that is meant to run your batchfile. I'm sure that's not the way you want to go. Use the standard way instead:converttoupper.bat /?` (你已经证明你知道如何处理参数,所以这个应该是微不足道的)
标签: batch-file command script