Jump to content

Office Shortcuts to users Desktop


eDecisions
 Share

Recommended Posts

Great for onboarding new station, you can grab any other short cuts such as to shared rive, or network folders, the users C drive or the my documents folder as well, I just did the office apps.

 

 

 

#By eDcisions

$Officepath = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe\Path")


$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$Home\Desktop\Excel.lnk")
$Shortcut.TargetPath = "$Officepath\Excel.exe"
$Shortcut.Save()

$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$Home\Desktop\Outlook.lnk")
$Shortcut.TargetPath = "$Officepath\Outlook.exe"
$Shortcut.Save()

$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$Home\Desktop\Word.lnk")
$Shortcut.TargetPath = "$Officepath\Winword.exe"
$Shortcut.Save()

Link to comment
Share on other sites

Darn, missed the fact that I was in session 0, ooops my bad, this should add to all active users.

 

$Officepath = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe\Path")


$Profiles = Get-ChildItem 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\ProfileList' | ForEach-Object { $_.GetValue('ProfileImagePath') }

foreach ($profile in $profiles -match "Users" -notmatch "spfarm" -notmatch "spsearch" -notmatch "TEMP" -notmatch "Classic"){


$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$Profile\Desktop\Excel.lnk")
$Shortcut.TargetPath = "$Officepath\Excel.exe"
$Shortcut.Save()

$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$Profile\Desktop\Outlook.lnk")
$Shortcut.TargetPath = "$Officepath\Outlook.exe"
$Shortcut.Save()

$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$Profile\Desktop\Word.lnk")
$Shortcut.TargetPath = "$Officepath\Winword.exe"
$Shortcut.Save()


}
 

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...