Site icon Winhelponline

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= >>"%userprofile%\desktop\google.url"
echo IconFile=e:\icons\google.ico  >>"%userprofile%\desktop\google.url"
echo IconIndex=0 >>"%userprofile%\desktop\google.url"
Exit mobile version