guolz0207 发表于 2014-2-10 09:56:13

总是提示表达式错误,请帮忙看看

RunWait(@ComSpec & "/C "&'for /f "tokens=2 delims=:" %a in (' "ipconfig | findstr "默认网关""')do(route add 192.0.0.0 mask 255.0.0.0%a &exit)', @SystemDir, @SW_HIDE)

D:\autoit3\autoit3\SciTe\调用dos命令测试.au3(7,92) : 错误: 表达式错误
        $foo = RunWait(@ComSpec & "/C "&'for /f "tokens=2 delims=:" %a in (' "ipconfig | findstr "
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\autoit3\autoit3\SciTe\调用dos命令测试.au3 - 1 错误, 0 警告

netegg 发表于 2014-2-10 10:19:53

本帖最后由 netegg 于 2014-2-10 10:55 编辑

RunWait(@ComSpec & "/C "&'for /f "tokens=2 delims=:" %a in (' & 'ipconfig | findstr "默认网关"' & ')do(route add 192.0.0.0 mask 255.0.0.0%a &exit)', @SystemDir, @SW_HIDE)

guolz0207 发表于 2014-2-10 13:54:29

多谢能说下什么情况下调用dos命令参数 才需要加' & '

fuldho 发表于 2014-2-10 16:30:59

RunWait(@ComSpec & '/Cfor /f "tokens=2 delims=:" %a in (ipconfig | findstr "默认网关")do(route add 192.0.0.0 mask 255.0.0.0%a &exit)', @SystemDir, @SW_HIDE)
页: [1]
查看完整版本: 总是提示表达式错误,请帮忙看看