Addding some programs to be started automatically when logging in
Open Outlook, Teams and Windows Terminal automatically when logging in (check first if applications are alread listed, possibly disabled, in
Startup Apps of the
Task Manager)
$startup = [Environment]::GetFolderPath('Startup')
$progs = "$env:ProgramData\Microsoft\Windows\Start Menu\Programs"
$outlookLnk = get-childItem $progs -recurse -filter "*Outlook*.lnk" | select-object -First 1
if ($outlookLnk) {
copy-item $outlookLnk.FullName $startup -force
}
$teamsLnk = get-childItem $progs -recurse -filter "*Teams*.lnk" |
where-object { $_.Name -notlike "*classic*" -and $_.Name -notlike "*work or school*" } |
select-object -first 1
if ($teamsLnk) {
copy-Item $teamsLnk.FullName $startup -force
}
$wtLnk = get-childItem $progs -recurse -filter "*Terminal*.lnk" |
where-object { $_.Name -like "*Windows Terminal*" } |
select-object -first 1
if ($wtLnk) {
copy-item $wtLnk.FullName $startup -Force
}
else {
# Fallback: create shortcut manually
$WshShell = new-object -comObject WScript.Shell
$shortcut = $WshShell.CreateShortcut("$startup\Windows Terminal.lnk")
$shortcut.TargetPath = "$env:LOCALAPPDATA\Microsoft\WindowsApps\wt.exe"
$shortcut.Save()
}