【问题标题】:What does the '^' mean in this Windows batch snippet? [duplicate]此 Windows 批处理代码段中的“^”是什么意思? [复制]
【发布时间】:2016-06-22 13:34:23
【问题描述】:

批量sn-p为:

for /f %%i in ('driverquery /si ^| findstr /C:"QD1000_RS232_DRIVER"') do set USB_DRIVER_FOUND=%%i

那么^ 是什么意思?

我尝试运行部分命令:

driverquery /si ^| findstr /C:"QD1000_RS232_DRIVER"

但是失败了:

ERROR: Invalid argument/option - '|'.
Type "DRIVERQUERY /?" for usage.

加1:

^的解释:(搜索^)

http://ss64.com/nt/syntax-esc.html

【问题讨论】:

    标签: batch-file cmd


    【解决方案1】:

    这是转义字符。它转义了管道,因此您可以将其放在字符串引号' ' 中,而无需外壳尝试将其用作管道。直接运行它会是

    driverquery /si | findstr /C:"QD1000_RS232_DRIVER"
    

    【讨论】:

      猜你喜欢
      • 2012-01-19
      • 2013-03-11
      • 2012-03-14
      • 2014-01-10
      • 2018-07-07
      • 1970-01-01
      • 2010-09-11
      • 1970-01-01
      相关资源
      最近更新 更多