使用VB脚本将变量的​​值传递给程序

时间:2014-02-17 03:10:29

标签: windows vbscript

下面的代码应该将strNumber的值复制到剪贴板中,但它会将“strNumber”字符串复制到剪贴板而不是它的值,如何解决它

Dim strNumber, SH

Set SH = WScript.CreateObject("WScript.Shell")

strNumber =Inputbox("Number","Input Required")

SH.Run ".\ClipboardCopy.exe set strNumber"
Set SH = Nothing

1 个答案:

答案 0 :(得分:2)

正如帕特里克所说:

Dim strNumber, SH

Set SH = WScript.CreateObject("WScript.Shell")

strNumber =Inputbox("Number","Input Required")

SH.Run ".\ClipboardCopy.exe set" & strNumber
Set SH = Nothing