Jump to content

Help with Dos script to launch explorer to a url or homepage


Recommended Posts

Posted

Hi guys,

 

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.

 

Phil

Posted

Hi @Phildw - have you tried escaping the ampersand with a caret?

 

e.g:

 

Original: http://www.google.co.uk/#q=edugeek&safe=active&sout=1

Escaped: http://www.google.co.uk/#q=edugeek^&safe=active^&sout=1

  • Thanks 1
Posted
iexplore.exe http://URLhere

 

Sorry, miss read it! - You need to add ^ before the &

 

Hi @Phildw - have you tried escaping the ampersand with a caret?

 

e.g:

 

Original: http://www.google.co.uk/#q=edugeek&safe=active&sout=1

Escaped: http://www.google.co.uk/#q=edugeek^&safe=active^&sout=1

 

No I haven't, I'll try that, thanks :)

 

Could you not just put speech marks around the URL so it takes it as absolute?

 

No, this breaks it unfortunately :( Cheers tho

  • 2 weeks later...
Posted

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.

 

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"

 

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.

 

start %userprofile%\Favorites\smartmoneycommunity.url

 

Hope this helps!

 

Andrew

Posted
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.

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



×
×
  • Create New...