SOLVED

Win32 app installed desktop shortcut with no custom icon

Brass Contributor

I'm installing a desktop shortcut to all my endpoints.  I'm installing it as a win32 app with this script.

 

#Create directory to hold icon file and copy file there
New-Item -Path "c:\" -Name "scut" -ItemType "directory" -Force
Copy-Item "S:\Shortcuts\UKGi.ico" -Destination "c:\scut\UKGi.ico"

#Shortcut creation and specify settings
$Shell = New-Object -ComObject ("WScript.Shell")
$ShortCut = $Shell.CreateShortcut("C:\users\public\desktop\UKG Time.lnk")
$ShortCut.TargetPath="---------------------------------------------- "
#$Shortcut.Arguments="---------------------------------------------- "
$ShortCut.IconLocation = "c:\scut\UKGi.ico";
$ShortCut.Description = "UKG Time";
$ShortCut.Save()

 

I already have a s: drive mapped to all my endpoints and I'm creating a folder on the c: drive of the destination pcs.  I'm copying the ico file from the mapped drive to the c: drive then installing the shortcut.  The desktop shortcut is created just fine.  I just don't get the custom icon.  The install behavior is via system.  I went into the app and added the custom icon jpg as the logo of the app itself.  Still no luck with the custom icon.  Any suggestions?  

10 Replies
I just dug into the issue a little deeper and it looks like a rights issue. I can create the shortcut but my users do not have admin rights to copy the ico file and link it to the shortcut. Has anyone worked around this issue before?

You should have all the files in your .Intunewin package. Copy-Item "S:\Shortcuts\UKGi.ico" -Destination "c:\scut\UKGi.ico" should be Copy-Item ".\UKGi.ico" -Destination "c:\scut\UKGi.ico" if the files are all in one folder from which you create the .intunewin package. Run this with the System installation behavior when configuring the settings in Intune and uploading the package.

The system account doesn't have the mapping in its environment, so it doesn't work the way it's configured right now.

Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.

If one of the posts was helpful in other ways, please consider giving it a Like.

I made the changes and everything is running in the test environment to see how it goes. I appreciate the help.
Let us know, curious!

@Harm_Veenstra I put the ico in the same folder that’s accessible on the share, rebuilt the Intunewin package, and completely removed the app from intune and set it up again. I’m still not getting the custom icon. The shortcut installs on the public desktop just fine. It just doesn’t have the icon. 

Could you show us the contents of the folder and the install script?

@Harm_Veenstra 

 

The install script.

 

#Create directory to hold icon file and copy file there
New-Item -Path "c:\" -Name "scut" -ItemType "directory" -Force
Copy-Item ".\UKGi.ico" -Destination "c:\scut\UKGi.ico

#Shortcut creation and specify settings
$Shell = New-Object -ComObject ("WScript.Shell")
$ShortCut = $Shell.CreateShortcut("C:\users\public\desktop\UKG Time.lnk")
$ShortCut.TargetPath="https://poarchbandcreeks-sso.prd.mykronos.com"
#$Shortcut.Arguments="https://poarchbandcreeks-sso.prd.mykronos.com"
$ShortCut.IconLocation = "c:\scut\UKGi.ico";
$ShortCut.Description = "UKG Time";
$ShortCut.Save()

 

Inside the folder.

Jesse13579_0-1705501127355.png

 

 

 

best response confirmed by Harm_Veenstra (MVP)
Solution
Copy-Item ".\UKGi.ico" -Destination "c:\scut\UKGi.ico ---> Copy-Item ".\UKGi.ico" -Destination "c:\scut\UKGi.ico" , you mist the last " I think ;)
I sure did. I just made the change and updated the app. I'll let you know. Thanks for the help.
1 best response

Accepted Solutions
best response confirmed by Harm_Veenstra (MVP)
Solution
Copy-Item ".\UKGi.ico" -Destination "c:\scut\UKGi.ico ---> Copy-Item ".\UKGi.ico" -Destination "c:\scut\UKGi.ico" , you mist the last " I think ;)

View solution in original post