相关疑难解决方法(0)

如何使SHIFT与批处理文件中的%*一起使用

在我在Windows XP上的批处理文件中,我想使用%*扩展到除第一个之外的所有参数.
测试文件(foo.bat):

@echo off
echo %*
shift
echo %*
Run Code Online (Sandbox Code Playgroud)

呼叫:

C:\> foo a b c d e f
Run Code Online (Sandbox Code Playgroud)

实际结果:

a b c d e f
a b c d e f
Run Code Online (Sandbox Code Playgroud)

期望的结果:

a b c d e f
b c d e f
Run Code Online (Sandbox Code Playgroud)

我怎样才能达到预期的效果?谢谢!!

windows-xp batch-file

35
推荐指数
2
解决办法
1万
查看次数

标签 统计

batch-file ×1

windows-xp ×1