Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 1.24 KB

README.md

File metadata and controls

31 lines (26 loc) · 1.24 KB

$users = Get-ChildItem -Path "C:\Users" -Name foreach ($user in $users) { $here= "C:\Users"+$user+"\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" $file = Get-ChildItem -Path $here -Name -ErrorAction SilentlyContinue Write-Host $here"" -NoNewline Write-Host $file -ForegroundColor Red }

$users = Get-ChildItem -Path "C:\Users" -Name foreach ($user in $users) { $here= "C:\Users"+$user+"\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" $files = Get-ChildItem -Path $here -Name -ErrorAction SilentlyContinue foreach ($file in $files) { Write-Host $here"" -NoNewline Write-Host $file -ForegroundColor Red }}

------------Finial Version------------

$users = Get-ChildItem -Path "C:\Users" -Name foreach ($user in $users) { $locations= "C:\Users"+$user+"\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" $files = Get-ChildItem -Path $locations -Name -ErrorAction SilentlyContinue if ($files -ne $null){ foreach ($file in $files){ Write-Host $locations"" -NoNewline Write-Host $file -ForegroundColor Red }} else{foreach ($location in $locations) { Write-Host $location""} }}

see