Create an Internet Shortcut Using Batch File

Q:  Is there a way to create a batch file which would put a desktop icon onto the desktop which invokes an HTML page in a web browser and change the associated icon for that particular desktop item, all in one batch file? Thanks

A: Yes. This is possible. Here are some examples:



echo [InternetShortcut] >"%userprofile%\desktop\localpage.url"
echo URL=C:\myfile.htm >>"%userprofile%\desktop\localpage.url"
echo IconFile=C:\icons\favicon.ico >>"%userprofile%\desktop\localpage.url"
echo IconIndex=0 >>"%userprofile%\desktop\localpage.url"
echo [InternetShortcut] >"%userprofile%\desktop\google.url"
echo URL=http://www.google.com/ >>"%userprofile%\desktop\google.url"
echo IconFile=e:\icons\google.ico  >>"%userprofile%\desktop\google.url"
echo IconIndex=0 >>"%userprofile%\desktop\google.url"

One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time.

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a ten-time recipient of the Microsoft MVP award in Windows Desktop Experience (Windows Shell), from 2003 to 2012. Ramesh founded Winhelponline.com in 2005.

Comments are closed.