Well, it's been a while since I've been able to post a new script. Guess I've been too busy using my skillz to pay the billz as they say... So today I'm posting a new script or rather, a snippet you can use in your own scripts. This comes directly from my library of functions and is used frequently in enterprise logon scripts.
As a system administrator, you may find it necessary to create a script to add a link to a user's favorites. There are several ways to do this including Group Policy, copying the .url or .lnk to the local computer, or vbscript. I could put my smartz hat on and show you how it's done via group policies but this is a scripting blog. I could also show you how to copy a shortcut file via copy, xcopy, or robocopy but that would be no fun.
So let's look at a script all ready, begeezus! Fine. There are really two things you can do. 1. Copy a premade link using the filesystemobject. Or, and better yet.. 2. Create a shortcut file on the fly using the Wscript.Shell object.
To use: Simply call CreateFavorite and pass the information.
Example: CreateFavorite "http://vbscripter.blogspot.com", "VBScript Blog", "VBScript Stuff"
This will create a link called "VBScript Blog" to this website in a folder called VBScript Stuff inside Favorites. Nifty.
Take note that this is ran locally so you'll need to execute it via logon script or some other method like remote scripting, etc. Enjoy!
Until next time (whenever that may be at this rate)!