Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
循环的Windows命令行_Windows_Batch File - Fatal编程技术网

循环的Windows命令行

循环的Windows命令行,windows,batch-file,Windows,Batch File,我希望获得用户通过Windows NT中的批处理文件输入的-c开关后的输入值 例如: 有人可以帮忙吗?可能是重复的 @REM Put the contents in a batch file @IF "" == "%1" @GOTO DONE :ARGS @IF "-c" == "%1" @GOTO PRINT @SHIFT @IF "" == "%1" @GOTO DONE @GOTO ARGS @GOTO DONE :PRINT @SHIFT @IF NOT "" == "%1" @EC

我希望获得用户通过Windows NT中的批处理文件输入的-c开关后的输入值

例如:

有人可以帮忙吗?

可能是重复的
@REM Put the contents in a batch file
@IF "" == "%1" @GOTO DONE

:ARGS
@IF "-c" == "%1" @GOTO PRINT
@SHIFT
@IF "" == "%1" @GOTO DONE
@GOTO ARGS
@GOTO DONE

:PRINT
@SHIFT
@IF NOT "" == "%1" @ECHO %1
@GOTO ARGS

:DONE
@REM End of file
@REM Put the contents in a batch file
@IF "" == "%1" @GOTO DONE

:ARGS
@IF "-c" == "%1" @GOTO PRINT
@SHIFT
@IF "" == "%1" @GOTO DONE
@GOTO ARGS
@GOTO DONE

:PRINT
@SHIFT
@IF NOT "" == "%1" @ECHO %1
@GOTO ARGS

:DONE
@REM End of file