首页 > 解决方案 > Scala Huygens Fokker(仅限命令行)v1.88b 不幸地删除了多余的空格

问题描述

批号:

scala.exe --SET SYNTH 117^
          --LOAD /MAPPING \"My mapping\"^
          --LOAD \"Intonation        with extra spaces\"^
          --SEND /FILE \"Test\"^
          --EXIT

它给了我输出:

Intonation with extra spaces.scl not found or not a scale file

使用批处理代码:

scala.exe --SET SYNTH 117^
          --LOAD /MAPPING \"My mapping\"^
          --LOAD \"Intonation without extra spaces\"^
          --SEND /FILE \"test\"^
          --EXIT

工作正常。

我怎样才能告诉批处理不要忽略多余的空格?

标签: batch-file

解决方案


不是scala.exe,但使用一个简单的命令行参数转储工具,我们得到

W:\>type 56190749.cmd
vcCmdLine.exe --SET SYNTH 117^
              --LOAD /MAPPING \"My mapping\"^
              --LOAD \"Intonation        with extra spaces\"^
              --SEND /FILE \"Test\"^
              --EXIT
W:\>56190749.cmd

W:\>vcCmdLine.exe --SET SYNTH 117              --LOAD /MAPPING \"My mapping\"              --LOAD \"Intonation        with extra spaces\"              --SEND /FILE \"Test\"              --EXIT
cmdline:[vcCmdLine.exe  --SET SYNTH 117              --LOAD /MAPPING \"My mapping\"              --LOAD \"Intonation        with extra spaces\"              --SEND /FILE \"Test\"              --EXIT]

arg_000:[vcCmdLine.exe]
arg_001:[--SET]
arg_002:[SYNTH]
arg_003:[117]
arg_004:[--LOAD]
arg_005:[/MAPPING]
arg_006:["My]
arg_007:[mapping"]
arg_008:[--LOAD]
arg_009:["Intonation]
arg_010:[with]
arg_011:[extra]
arg_012:[spaces"]
arg_013:[--SEND]
arg_014:[/FILE]
arg_015:["Test"]
arg_016:[--EXIT]

W:\>

报价转义的简化给出

W:\>type 56190749.cmd
vcCmdLine.exe --SET SYNTH 117^
              --LOAD /MAPPING "My mapping"^
              --LOAD "Intonation        with extra spaces"^
              --SEND /FILE "Test"^
              --EXIT
W:\>56190749.cmd

W:\>vcCmdLine.exe --SET SYNTH 117              --LOAD /MAPPING "My mapping"              --LOAD "Intonation        with extra spaces"              --SEND /FILE "Test"              --EXIT
cmdline:[vcCmdLine.exe  --SET SYNTH 117              --LOAD /MAPPING "My mapping"              --LOAD "Intonation        with extra spaces"              --SEND /FILE "Test"              --EXIT]

arg_000:[vcCmdLine.exe]
arg_001:[--SET]
arg_002:[SYNTH]
arg_003:[117]
arg_004:[--LOAD]
arg_005:[/MAPPING]
arg_006:[My mapping]
arg_007:[--LOAD]
arg_008:[Intonation        with extra spaces]
arg_009:[--SEND]
arg_010:[/FILE]
arg_011:[Test]
arg_012:[--EXIT]

W:\>

如果参数内部需要双引号,那么我们可以使用

W:\>type 56190749.cmd
vcCmdLine.exe --SET SYNTH 117^
              --LOAD /MAPPING "\"My mapping\""^
              --LOAD "\"Intonation        with extra spaces\""^
              --SEND /FILE "\"Test\""^
              --EXIT
W:\>56190749.cmd

W:\>vcCmdLine.exe --SET SYNTH 117              --LOAD /MAPPING "\"My mapping\""              --LOAD "\"Intonation        with extra spaces\""              --SEND /FILE "\"Test\""              --EXIT
cmdline:[vcCmdLine.exe  --SET SYNTH 117              --LOAD /MAPPING "\"My mapping\""              --LOAD "\"Intonation        with extra spaces\""              --SEND /FILE "\"Test\""              --EXIT]

arg_000:[vcCmdLine.exe]
arg_001:[--SET]
arg_002:[SYNTH]
arg_003:[117]
arg_004:[--LOAD]
arg_005:[/MAPPING]
arg_006:["My mapping"]
arg_007:[--LOAD]
arg_008:["Intonation        with extra spaces"]
arg_009:[--SEND]
arg_010:[/FILE]
arg_011:["Test"]
arg_012:[--EXIT]

W:\>

当然scala.exe可能会有一些特定的行为,但这是开始尝试的一种方式。


推荐阅读