This is an old revision of the document!
Add the ability to add a program to the Startup folder using the SendTo context menu.
Save the following code somewhere:
param([System.IO.FileInfo]$Path) $Name = Split-Path -Path $Path -leaf $Shell = New-Object -ComObject ("WScript.Shell") $ShortCut = $Shell.CreateShortcut($env:APPDATA + "\Microsoft\Windows\Start Menu\Programs\Startup\$Name.lnk") $ShortCut.TargetPath = $Path $ShortCut.Save()
Then create a shortcut in: %APPDATA%\Microsoft\Windows\SendTo
with the target set to %windir%\System32\WindowsPowerShell\v1.0\powershell.exe -File "C:\path\to\Startup.ps1"
and set the icon to what you want.
Note: Can save the Startup.ps1
file to the SendTo folder if desired, because it doesn't show up in the list itself.