Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group policy for URL shortcut 1

Status
Not open for further replies.
Nov 18, 2005
43
US
Hi wondering if I could use group policy to have a URL shortcut created on users desktop.

I found out where to add it to their favorites but wondering if desktop is possible.

Thanks.

Maybe I should try the VB script forum.
 
Code:
On Error resume next
SET fso = Wscript.CreateObject("Scripting.FileSystemObject")
SET WshShell = WScript.CreateObject("WScript.Shell")

'Create the icon in the user's Favorites Folder
strFavs = WshShell.SpecialFolders("Favorites")
strshortcut = strFavs & "\Companyweb.url"
If Not fso.FileExists(strshortcut) Then
	SET oUrlLink = WshShell.CreateShortcut(strshortcut)
	oUrlLink.TargetPath = "[URL unfurl="true"]http://companyweb"[/URL]
	oUrlLink.Save
End If

'Now create the icon on the Users Desktop  
'Note: to create the icon for all users use the Special Folder [b]AllUsersDesktop[/b]
strFavs = WshShell.SpecialFolders("Desktop")
strshortcut = strFavs & "\Companyweb.url"
If Not fso.FileExists(strshortcut) Then
	SET oUrlLink = WshShell.CreateShortcut(strshortcut)
	oUrlLink.TargetPath = "[URL unfurl="true"]http://companyweb"[/URL]
	oUrlLink.Save
End If

I hope you find this post helpful.

Regards,

Mark
 
nice one. would this work using logon script. not sure if a user needs to be an admin to write to the alluserdesktops
 
yes, you can do it as a login script which will then execute with elevated permissions.

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top