My splash screen runs the following code to create a shortcut:
However, a user logged as e.g User6 or User4 it works fine.
If, as in my laptop, the user logs in as Administrator on XP, the shortcut is not created .
I ran some error checking and 0 was returned as error code, obviously without err.Description.
Anybody any ideas ?
Dim objShell As IWshShell_Class Dim objShortcut As IWshShortcut_Class Dim FolderItem As Variant Dim lsPath As String Dim lsShortCut As String Dim lsURL As String Dim lsConfigFileName As String Dim nType As Variant Set objShell = New IWshShell_Class lsShortCut = App.Title lsPath = App.Path & "" & App.EXEName For Each FolderItem In objShell.SpecialFolders If Mid(FolderItem, Len(FolderItem) - 6, 7) = "Desktop" And _ InStr(1, FolderItem, "All Users") = 0 And _ InStr(1, UCase(FolderItem), "ADMINISTRATOR") = 0 Then Set objShortcut = objShell.CreateShortcut(FolderItem & _ "" & _ lsShortCut & _ ".lnk") objShortcut.TargetPath = lsPath objShortcut.Arguments = lsURL & " " & _ lsConfigFileName & " " & _ CStr(nType) objShortcut.IconLocation = "L:MMpdfutilitiesroldx01d.ico" objShortcut.Save End If Next