Link to home
Start Free TrialLog in
Avatar of James
JamesFlag for Canada

asked on

Using the clip utility with special characters

I'm trying to copy text to the clipboard from the command line. If I try something simple like:

ECHO test | CLIP

it works fine and puts the word test in the clipboard. My problem is that I have a special character (specifically an ampersand) in the text I want to copy and it makes the clip utility choke:

ECHO http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=1ZV300F20358346597 | CLIP

If I try the same text without the ampersand, it works fine so I know it's the ampersand that is causing the problem.

I tried using quotation marks like this:

ECHO "http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=1ZV300F20358346597" | CLIP

That gets rid of the error but the quotation marks get copied to the clipboard, too.

Any ideas?

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of James

ASKER

Thank you! It would have been a LONG time before I figured that out on my own. :)