![]() |
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. |
Re: windows script help needed
Encode was where i got confused Tim sorry mate lol
|
Re: windows script help needed
Does this help? Can you adapt it? Try PMing TSM, he's a geek.
http://www.syronex.com/antispam/help...cipient-mailto |
Re: windows script help needed
unfortunately that is javascript. What I am attempting to do is format arguments that I will pass to a wget command. So they have to look as if a browser etc has already encoded them
|
Re: windows script help needed
I'm guessing it's not just spaces your trying to encode as %20
If it is, does this little batch file help? @echo off echo %1%%20%2%%20%3 run it as test.bat test1 test2 test3 and the output is test1%20test2%20test3 Probably a bit basic, and not sure how you would make it work for different length strings though .... |
Re: windows script help needed
i assume that you are using the linux "wget" port, you could with a perl script do below.
Code:
#!/usr/bin/perl Code:
wget "http://server/file to get.html" |
All times are GMT. The time now is 12:27 PM. |
Powered by vBulletin® - Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.