none
Adding shortcut on desktop for webpage after deployment RRS feed

  • Question

  • Hi,

    I have specific request that I put a shortcut on desktop for web page in IE. So that after deployment there will be an icon, on which user can click and it wll take them to the specific website, opened in IE or Edge.

    Does anyone have a suggestion on how to do this?

    Thanks

    Sven

    Thursday, December 28, 2017 2:55 PM

Answers

  • NorPersonally I would use PowerShell and create a shortcut on the default desktop (meaning that every user will get the shortcut and would need admin permissions to remove it). Here is a quick example I put together:

    # Determine where to do the logging 
    $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment 
    $logPath = $tsenv.Value("LogPath") 
    $logFile = "$logPath\$($myInvocation.MyCommand).log"
     
    # Start the logging 
    Start-Transcript $logFile
    Write-Host "Logging to $logFile"
    
    # Main code
    $Shell = New-Object -ComObject ("WScript.Shell")
    $ShortCut = $Shell.CreateShortcut("C:\Users\Default\Desktop\Shortcut.lnk")
    $ShortCut.TargetPath="https://www.google.com"
    $ShortCut.WindowStyle = 1;
    $ShortCut.IconLocation = "C:\Program Files\internet explorer\iexplore.exe, 0";
    $ShortCut.Description = "Shortcut Description";
    $ShortCut.Save()
    
    # Stop logging 
    Stop-Transcript


    Cheers,
    Anton

    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    • Marked as answer by ssivic Friday, January 5, 2018 8:32 AM
    Thursday, December 28, 2017 7:49 PM

All replies

  • NorPersonally I would use PowerShell and create a shortcut on the default desktop (meaning that every user will get the shortcut and would need admin permissions to remove it). Here is a quick example I put together:

    # Determine where to do the logging 
    $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment 
    $logPath = $tsenv.Value("LogPath") 
    $logFile = "$logPath\$($myInvocation.MyCommand).log"
     
    # Start the logging 
    Start-Transcript $logFile
    Write-Host "Logging to $logFile"
    
    # Main code
    $Shell = New-Object -ComObject ("WScript.Shell")
    $ShortCut = $Shell.CreateShortcut("C:\Users\Default\Desktop\Shortcut.lnk")
    $ShortCut.TargetPath="https://www.google.com"
    $ShortCut.WindowStyle = 1;
    $ShortCut.IconLocation = "C:\Program Files\internet explorer\iexplore.exe, 0";
    $ShortCut.Description = "Shortcut Description";
    $ShortCut.Save()
    
    # Stop logging 
    Stop-Transcript


    Cheers,
    Anton

    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    • Marked as answer by ssivic Friday, January 5, 2018 8:32 AM
    Thursday, December 28, 2017 7:49 PM
  • Thanks a lot, this solved my problems!
    Friday, January 5, 2018 8:32 AM