Create an Internet Shortcut Using Batch File

0 Shares

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 browswer (MSIE) 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:

——————–Launches a HTML page—————
echo [InternetShortcut] >”%userprofile%\desktop\localpage.url”
echo URL=C:\myfile.htm >>”%userprofile%\desktop\localpage.url”
echo IconFile=C:\favicon.ico >>”%userprofile%\desktop\localpage.url”
echo IconIndex=0 >>”%userprofile%\desktop\localpage.url”
————————————————————

——————–Launches a website——————–
echo [InternetShortcut] >”%userprofile%\desktop\google.url”
echo URL=http://www.google.com/ >>”%userprofile%\desktop\google.url”
echo IconFile=e:\Backups\google.ico  >>”%userprofile%\desktop\google.url”
echo IconIndex=0 >>”%userprofile%\desktop\google.url”
————————————————————

0 Shares

About the author

Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and has a vast experience in the ITeS industry — delivering support for Microsoft's consumer products. He has been a Microsoft MVP [2003 to 2012] who contributes to various Windows support forums.

2 thoughts on “Create an Internet Shortcut Using Batch File”

  1. How do I modify the url path on an existing internet shortcut? I have a .bat file that removes an existing shortcut and creates a new one, but the new shortcut has the old url.

  2. simply change the .bat file extension to .txt for editing.
    after finish editing, save and close it. then change the extension file back to .bat

    Run and done..

Comments are closed.