从字符串中的特殊位置开始说一句话

时间:2013-10-04 22:58:02

标签: batch-file cmd

我需要帮助的是用户输入字符串:commandLine("Dir") 然后它将从commandLine("Dir")获取Dir并将其变为变量

示例:

C:\> program.bat commandLine("Dir")

program.bat:

echo the command is: Dir

pause

1 个答案:

答案 0 :(得分:1)

试试这个:

echo off
set str=%1
set str=%str:CommandLine("=%
set str=%str:")=%
echo on
echo the command is: %str%
相关问题