VBScript 在带空格的路径中传递命令行参数 [英] VBScript pass commandline argument in paths with spaces

查看:30
本文介绍了VBScript 在带空格的路径中传递命令行参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 VBS shell.run 来运行带有脚本参数的 nircmd 程序.例如,这有效:

I am trying to use VBS shell.run to run nircmd program with a script argument. For example, this works:

objShell.Run """D:\App Run\NirCmd\nircmd.exe""script D:\testfolder\test.txt"

但是,如果参数路径中有任何空格,它就不起作用,我在参数路径上尝试了双引号但没有成功.这不起作用:(参数中的空格)

However if there are any spaces in the argument path it does not work and I have tried double quotes on the argument path with no luck. This does not work: (space in argument)

objShell.Run """D:\App Run\NirCmd\nircmd.exe""script D:\test folder\test.txt" 

我需要能够在参数路径中有空格.感谢您的帮助

I need the ability to have spaces in the argument path. thanks for any help

推荐答案

尝试:

objShell.Run """D:\App Run\NirCmd\nircmd.exe"" script ""D:\test folder\test.txt"""

这篇关于VBScript 在带空格的路径中传递命令行参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆