URL into alias?

May 20, 2008
11,400
99
Syracuse, NY, USA
This target works in a shortcut.

Code:
http://forecast.weather.gov/MapClick.php?CityName=Syracuse&state=NY&site=BGM&textField1=43.0446&textField2=-76.1459&e=0
To use it in an alias, I escaped the ampersands thus:

Code:
http://forecast.weather.gov/MapClick.php?CityName=Syracuse^&state=NY^&site=BGM^&textField1=43.0446^&textField2=-76.1459^&e=0
But when I use the alias or simply issue the escaped version at the command prompt, it doesn't work.

How do I get it into an alias or even simply issue it at the command prompt?
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
Quote it. That worked for me.

"
http://forecast.weather.gov/MapClick.php?CityName=Syracuse&state=NY&site=BGM&textField1=43.0446&textField2=-76.1459&e=0
"

-Scott

vefatica <> wrote on 01/10/2011 04:12:02 PM:


> This target works in a shortcut.
>
>
> Code:
> ---------
> http://forecast.weather.gov/MapClick.php?
>
CityName=Syracuse&state=NY&site=BGM&textField1=43.0446&textField2=-76.1459&e=0

> ---------
> To use it in an alias, I escaped the ampersands thus:
>
>
> Code:
> ---------
> http://forecast.weather.gov/MapClick.php?
> CityName=Syracuse^&state=NY^&site=BGM^&textField1=43.
> 0446^&textField2=-76.1459^&e=0
> ---------
> But when I use the alias or simply issue the escaped version at the
> command prompt, it doesn't work.
>
> How do I get it into an alias or even simply issue it at the command
prompt?
 
May 20, 2008
11,400
99
Syracuse, NY, USA
On Mon, 10 Jan 2011 16:26:24 -0500, samintz <> wrote:

|Quote it. That worked for me.
|
|"
|http://forecast.weather.gov/MapClick.php?CityName=Syracuse&state=NY&site=BGM&textField1=43.0446&textField2=-76.1459&e=0
|"

OK, I'll try that in a minute. But what's really odd is if I just type the URL
from the shortcut at the prompt the ampersands are treated as command separators
(that's expected). But if I type the URL with escaped ampersands, the escape
characters wind up being sent to the internet. Network trace snippet:

Code:
P.......GET./Map
Click.php?CityNa
me=Syracuse^&sta
te=NY^&site=BGM^
&textField1=43.0
446^&textField2-76.1459^&e=0.HT

If the escaping keeps TCC from treating the ampersands as command separators,
then shouldn't they be removed?

Tried it. Quoting works. Thanks.
 

rconn

Administrator
Staff member
May 14, 2008
12,344
149
> OK, I'll try that in a minute. But what's really odd is if I just type
the URL

> from the shortcut at the prompt the ampersands are treated as command
> separators (that's expected). But if I type the URL with escaped
ampersands,

> the escape characters wind up being sent to the internet.

An URL is not a command, and does not get parsed (and escape characters
removed) like a command.

As the help says, all URLs should be double quoted. The parser can
sometimes figure it out without the quotes, but you're skating on thin ice.

Rex Conn
JP Software
 
May 20, 2008
11,400
99
Syracuse, NY, USA
On Tue, 11 Jan 2011 11:55:53 -0500, rconn <> wrote:

|---Quote---
|> OK, I'll try that in a minute. But what's really odd is if I just type
|---End Quote---
|the URL
|
|
|---Quote---
|> from the shortcut at the prompt the ampersands are treated as command
|> separators (that's expected). But if I type the URL with escaped
|---End Quote---
|ampersands,
|
|
|---Quote---
|> the escape characters wind up being sent to the internet.
|---End Quote---
|An URL is not a command, and does not get parsed (and escape characters
|removed) like a command.
|
|As the help says, all URLs should be double quoted. The parser can
|sometimes figure it out without the quotes, but you're skating on thin ice.

Rex, it often happens that you reply quoting the OP in little chunks with your
comments in between (no complaint, I like that style). But when you do, the
quoting is all screwed up, with **most** of each quote actually inside the quote
indicators, and the last little bit outside, on the next line, not quoted. It
looks bad enough on the web forum and makes the plain text emails very hard to
read. How do you manage to to that? I don't think I could if I tried.
 
Similar threads
Thread starter Title Forum Replies Date
vefatica START /PGM "name with spaces.URL" fails Support 2
Mordachai How to pass URL to sendmail? Support 10
S Feedback URL Support 6
P ISFILE with url Support 7
noahcoad How to? Prevent web url from opening after silent install Support 0
Phileosophos The @urlencode function doesn't seem to URL encode Support 16
D Can alias pass parameters to for command? Support 3
Jay Sage Issue with CD_ENTER Alias Support 37
Jay Sage Issue with CD_LEAVE Alias Support 3
Jay Sage WAD Failure of Alias Command with /Z Option Support 14
R @select inside alias gives different (insanely small) window Support 7
kb6ojs ALIAS with multiple commands? Support 9
vefatica Can I alias @@Ctrl-Shift-Alt-u? Support 4
D Alias with setdos no longer works Support 21
vefatica TPIPE in an alias? Support 2
Peter Murschall TCC V26.01.3x Debugging has problems with Alias /R Support 1
Peter Murschall CMDebug 26.01.37 has problems with Alias Support 21
samintz How to? Alias or prompt? Support 1
MickeyF expand alias in cmdline with Ctrl-F in TCC Support 21
Jay Sage Directory Alias Access to FTP Servers Support 2
rps How to? Shralias and producing history.sav, alias.sav .. Support 6
J Alias @@F5 hotkey Support 2
vefatica alias.sav not accurate Support 8
Joe Caverly Using a Directory Alias with @iniwrite fails Support 14
N multiple command alias and redirection Support 0
vefatica SETLOCAL ... ALIAS ... pipes Support 2
B TCC 21.01.50 Problem with ALIAS /r and SET /r Support 2
rps How to? Alias/Command line use of *log on/off Support 2
MickeyF alias terminating before it should Support 3
JohnQSmith ALIAS /R in TCSTART.BTM Support 9
D Alias in batch file Support 3
vefatica Can't execute @ALIAS[...] Support 5
E How to? Load Alias File on Startup Support 3
I Windows 10 console does not allow alt-F4 alias to complete Support 1
MickeyF create an alias with optional parameter Support 4
nickles Alias expansion Support 7
T scrput `` in alias or function Support 2
vefatica Alias works differenltly v16 vs. v17 Support 13
B Alias with multi line definitions not assigned Support 6
jbanaszczyk Alias with space in the name Support 3
jbanaszczyk Alias for internal command Support 8
D Clear alias parameters Support 7
T Fixed multi-line alias issue Support 13
keithg1964 WAD 16.0027 Alias /rz bug Support 8
R In addition to ALIAS /Z and FUNCTION /Z, HISTORY /Z? Support 1
tmaynard How to? Control-U alias for Escape (command line editing) Support 5
C Alias ListEmptyFldrs=??? Support 4
M How to? Put logic into an alias... Support 6
G How to? v15: Can't alias Alt-Z Support 7
nikbackm v15: Problem with ALIAS in command group Support 10

Similar threads