Hi there,
i've made a script wich maps the users homedir and places a shortcut on the desktop.
I've put the network drive icon in the script and tested it.
The funny thing is the first time the script runs it just runs perfect, but when u press F5, the icon network drive icon dissapears and when u click the icon wich appears instead u will get the "open program with" pop up screen..
Here is the code:
Option Explicit
Dim objNetwork, objUser, CurrentUser
Dim strGroup, strDesktopFolder
Dim objshell, objshortcut
'Initialise Groups with Const
Const test_Group = "cn=testgroep"
Const iedereen_Group= "cn=iedereen"
' Create objects and extract strGroup values
Set objNetwork = CreateObject("WScript.Network")
Set objUser = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & objUser.UserName)
strGroup = LCase(Join(CurrentUser.MemberOf))
'*************Networkmapping shortcuts*************
'Datainc\data snelkoppeling
Set objShell = WScript.CreateObject("WScript.Shell")
strDesktopFolder = objShell.SpecialFolders("allusersDesktop")
Set objShortCut = objShell.CreateShortcut(strDesktopFolder & _
"\k:.lnk")
objShortCut.TargetPath = chr(34) & "\\servername\data" & chr(34)
ObjShortCut.IconLocation = "C:\windows\system32\shell32.dll, 9"
objShortCut.Save
'homedrive snelkoppeling
Set objShell = WScript.CreateObject("WScript.Shell")
strDesktopFolder = objShell.SpecialFolders("allusersDesktop")
Set objShortCut = objShell.CreateShortcut(strDesktopFolder & _
"\J:.lnk")
objShortCut.TargetPath = "\\servername\users\"_
& objNetwork.UserName
ObjShortCut.IconLocation = "C:\windows\system32\shell32.dll, 9"
objShortCut.Save
Can someone please tell me what i am doing wrong?
