Sorry, miss read it! - You need to add ^ before the &
I have a script which I run as part of a .cmd that is run to launch a specific website in internet explorer when users logon. The problem I am having is that the url has a '&' in it which dos won't parse properly. I've been trawling the net but couldn't find a solution. I then tried to set the url i wanted as the homepage for that user via AD, but then couldn't find a way to make the script launch IE just to the homepage, it seems to need to have a url passed as an argument.
Any help much appreciated.
Last edited by SovietRussia; 13th September 2013 at 11:55 AM.
Hi @Phildw - have you tried escaping the ampersand with a caret?
Code:Original: http://www.google.co.uk/#q=edugeek&safe=active&sout=1 Escaped: http://www.google.co.uk/#q=edugeek^&safe=active^&sout=1
Could you not just put speech marks around the URL so it takes it as absolute?
That worked a treat, thanks guys.
Btw, any ideas on how to make it start up without needing an address passed to it?
Only way I could think of would be point it at a shortcut instead. But that's just adding a step where it isn't needed
I had to do something very similar to this at work, and I took it in a two step approach. First I used a batch file to add the link to everyone's favorites.
After that, I simply wrote a script to launch that link, and then added it to the startup folder, so it runs as soon as the computer is turned on.Code:echo [InternetShortcut] >"%userprofile%\favorites\smartmoneycommunity.url" echo URL=http://www.smartmoneycommunity.org/ >>"%userprofile%\favorites\smartmoneycommunity.url" echo IconFile=e:\Backups\smartmoneycommunity.ico >>"%userprofile%\favorites\smartmoneycommunity.url" echo IconIndex=0 >>"%userprofile%\favorites\smartmoneycommunity.url"
Hope this helps!Code:start %userprofile%\Favorites\smartmoneycommunity.url
You can just run it as part of the shortcut. No need for a cmd
very good point... in which case you could just modify the original code to save it in \startup instead of \Favorites, and save a step. We did it this way and saved it on a public network drive, then just sent everyone a link to the file and it auto installed it. Very simple.
There are currently 1 users browsing this thread. (0 members and 1 guests)