user551015
user551015

Reputation: 21

How could I add bookmarks to Internet Explorer with a batch script?

As the title says - is there a batch script (preferably with an example) that I could use to add bookmarks to Internet Explorer specifically?

Thanks.

Upvotes: 2

Views: 15308

Answers (3)

i_am_jorf
i_am_jorf

Reputation: 54600

Internet Explorer favorites are just text files with the .url extension formated like an .ini file that live in the user's Favorites folder.

You can't get the Favorites folder with the cmd processor (i.e. you can't get a direct path to the Favorites folder using a traditional batch file), the best you can do is assume that something like cd /d %USERPROFILE%\Favorites will work.

Using the WScript stuff is probably a better solution.

Upvotes: 0

RealHowTo
RealHowTo

Reputation: 35372

Using a command file

echo [InternetShortcut] > "%userprofile%\Desktop\Google.URL"
echo URL=http://www.google.com >> "%userprofile%\Desktop\Google.URL"
echo IconFile=http://www.google.com/favicon.ico >> "%userprofile%\Desktop\Google.URL"
echo IconIndex=0 >> "%userprofile%\Desktop\Google.URL"

Upvotes: 2

HSBallina
HSBallina

Reputation: 434

You can use VBScript for creating .URL files. This one will put the shortcut on the desktop but you can put them somewhere else if you like.

set WshShell = WScript.CreateObject("WScript.Shell")
desktopFolder = WshShell.SpecialFolders("Desktop")
set link = WshShell.CreateShortcut(desktopFolder & "\Stack Overflow.url")
link.TargetPath = "http://stackoverflow.com"
link.Save

.stompp

Upvotes: 0

Related Questions