View Single Post
Old 13-07-07, 02:51 PM   #1
timwilky
Member
Mega Poster
 
timwilky's Avatar
 
Join Date: Mar 2004
Location: Not in Yorkshire. (Thank God)
Posts: 4,116
Default windows script help needed

I need to encode some text in order to use it within a url.

for instance space characters need to be encoded as %20 etc.

I was tying to use the character substitution in an environment variable

for instance

SET STRING=%1%
SET STRING=%STRING: =%20% (How to I escape the % in the %20)
echo %STRING%

Where the argument to the script would be the text to encode " delimited, ie. "encode this string" where I would expect the output to be "encode%20this%20string"

Otherwise I am going to have to write a bit of C just to do this noddy requirement.
__________________
Not Grumpy, opinionated.

Last edited by timwilky; 13-07-07 at 02:54 PM.
timwilky is offline   Reply With Quote