Matt Bartlett
Matt Bartlett

Reputation: 360

Opening a URL with an equals in it

I am looking to create a very simple batch file to open a URL. It's so simple I'm just usingstart URL.

The problem is that in the URL there are some '=' signs ie.context=user&overlay=node and this is stopping the batchfile from opening the full URL.

How can I stop this.

Kind regards

Matt

Upvotes: 1

Views: 2342

Answers (2)

Hackoo
Hackoo

Reputation: 18837

& and = are specials characters in batch scripting. Just quote the URL and pass an empty string as the title like that :

@echo off
start "" "https://example.com/context=user&overlay=node"

Upvotes: 1

cjs1978
cjs1978

Reputation: 529

You should probably url-encode the equal signs to %3D - see for instance https://en.wikipedia.org/wiki/Percent-encoding.

Upvotes: 1

Related Questions