Jump to content

Pass url to browser with ampersand with it

Go to solution Solved by sakej,

Recommended Posts

Hi you all :)

I have a problem, when I'm trying to open a browser with a specific url that contains ampersand browsers will cut it where ampersand is.

When I'm trying to encode it with %26 it gets passed as an url but the website says that's the wrong url ;/

link looks like that: http://<IP>/nagios/cgi-bin/extinfo.cgi?type=1&host=<host number>


I did try to use

$cmd1 = "start msedge http://<IP>/nagios/cgi-bin/extinfo.cgi?type=2&amphost=" & $psdNumber"

Run(@ComSpec & " /c title " & $psdNumber & "&&" & $cmd1 & "&& pause")


and also

$url = "http://<IP>/nagios/cgi-bin/extinfo.cgi?type=2&host=" & $psdNumber"

$rc = _RunDos("start " & $url)


I've even tried to send it as a special char {&} and as ascii Chr(38) but also no luck...


any ideas?



Edited by sakej
Link to comment
Share on other sites

  • Solution
Posted (edited)

If anyone has the same issue in the future, here's how I manage to make it work as expected


ShellExecute("http://<ip>/nagios/cgi-bin/extinfo.cgi?type=1&host=" & $psdNumber)

Edited by sakej
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...