【发布时间】:2022-01-04 12:55:34
【问题描述】:
我所说的“纯”是指,我已经知道如何制作简单的自定义命令,例如
set /p command=
if "command"="Hello" goto print
:print
echo World
我想做类似的东西
set /p command=
if "command" starts with "/" goto print
:print
echo "%command%" without "/"
【问题讨论】:
-
这能回答你的问题吗? What is the best way to do a substring in a batch file? 具体来说,您可以对第一个字符使用
%string:~0,1%,对字符串的其余部分使用%string:~1%。 -
复杂批处理对我来说太混乱了。有没有更简单的方法,或者你能给我代码吗?
-
那是它的代码。
标签: batch-file cmd