Vbscript 在引号和空格中使用引号运行命令
这是我需要的线路Vbscript 在引号和空格中使用引号运行命令,vbscript,Vbscript,这是我需要的线路 C:\program.exe switch "quotedstring" 我尝试了很多双引号、双引号和Chr(34)的尝试,但都没有成功 objShell.Run """C:\program.exe"" & ""switch"" & Chr(34) & ""quotedstring"" & Chr(34)" 我接近了吗?不要胡思乱想,用系统的方法。 以下是解决您的问题的“算法”: 从原始字符串开始 将每一个“替换为” 在开头和结尾加上“和”
C:\program.exe switch "quotedstring"
我尝试了很多双引号、双引号和Chr(34)的尝试,但都没有成功
objShell.Run """C:\program.exe"" & ""switch"" & Chr(34) & ""quotedstring"" & Chr(34)"
我接近了吗?不要胡思乱想,用系统的方法。 以下是解决您的问题的“算法”:
- 从原始字符串开始
- 将每一个“替换为”
- 在开头和结尾加上“和”
C:\program.exe switch "quotedstring"
将“替换为”
在开始和结束处添加“:
"C:\program.exe switch ""quotedstring"""
应该这样做
"C:\program.exe switch ""quotedstring"""