Set FSO = CreateObject("scripting.filesystemobject")
Set objShell = WScript.CreateObject("WScript.Shell")
strDesktop = objShell.SpecialFolders("Desktop")

' Could you believe this is a comment? I know, vbs sucks
'
' The following is a dictionary of dictionaries.
' The first dictionary is keyed by group name (case sensitive!)
' while the second holds the attributes for the link to be created.
' With the example cfg below the script will create a link on the desktop
' of all users in the app_NOTEPAD group.
'
' To add a new link duplicate lines 22-28 and customize to taste
' Remember: options are all required (or improve this script so that
' some can actually be left empty)
'
' After that create a new AD group with the same name as the key
' you specified at line 28
'
Set shortcuts = CreateObject("Scripting.Dictionary") 

Set app = CreateObject("Scripting.Dictionary") 
app.Add "nome", "NOTEPAD.lnk"
app.Add "arguments", ""
app.Add "targetpath", "%windir%\system32\notepad.exe"
app.Add "workingdirectory", "%windir%\system32\notepad.exe"
app.Add "icon", "%windir%\system32\notepad.exe"
shortcuts.Add "app_NOTEPAD", app

Set oMember = GetObject("WinNT://"+objShell.ExpandEnvironmentStrings("%UserDomain%")+"/" + objShell.ExpandEnvironmentStrings("%UserName%"))

For Each oGroup in oMember.Groups
    wscript.echo oGroup.Name
    If shortcuts.Exists(oGroup.Name) Then
  	wscript.echo "     Trovato shortcut: " & oGroup.Name
		Set scut = shortcuts.Item(oGroup.Name)
		If FSO.FileExists(strDesktop & "\" & scut.Item("nome")) = True Then
			FSO.GetFile( strDesktop & "\" & scut.Item("nome") ).Delete(True)
		End If
		Set oMyShortcut = objShell.CreateShortcut( strDesktop & "\" & scut.Item("nome") )
		oMyShortcut.WindowStyle      = 3  'Maximized 7=Minimized  4=Normal 
		oMyShortcut.IconLocation     = scut.Item("icon")
		oMyShortcut.Arguments        = scut.Item("arguments")
		oMyShortcut.TargetPath       = scut.Item("targetpath")
		oMyShortcut.WorkingDirectory = scut.Item("workingdirectory")
		oMyShortCut.Save
	End If
Next