0

The code below should copy strNumber's value into clipboard, but it will copy the "strNumber" string into clipboard and not its value, how to fix it

Dim strNumber, SH

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

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

SH.Run ".\ClipboardCopy.exe set strNumber"
Set SH = Nothing
2
  • 3
    Not sure what ClipboardCopy.exe does and takes, but it should be SH.Run ".\ClipboardCopy.exe set " & strNumber Commented Feb 17, 2014 at 6:07
  • ClipboardCopy.exe is just an example of an application name Commented Feb 17, 2014 at 14:16

1 Answer 1

2

As PatricK said:

Dim strNumber, SH

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

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

SH.Run ".\ClipboardCopy.exe set" & strNumber
Set SH = Nothing
Sign up to request clarification or add additional context in comments.

2 Comments

Shouldn't there be a space after "... set"?
Thanks For your Answer it is working Now, and Ekkehard.Horner is right, and after set a space is needed...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.