Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ScriptPath = $MyInvocation.MyCommand.Definition
- $ScriptExecPath = "C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe -File "
- $ScriptFullExecPath = $ScriptExecPath + $ScriptPath
- Set-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce" "NextRun" $ScriptFullExecPath
- Restart-Computer
- #oneliners
- #powershell -c "IEX (New-Object Net.WebClient).DownloadString('https://pastebin.com/raw/1C9zQrU3')"
- #Set-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce" "NextRun" "C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe -File $($MyInvocation.MyCommand.Definition)";Restart-Computer
Add Comment
Please, Sign In to add comment