Reputation: 21
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
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
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
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