Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem https://www.howtogeek.com/204088/how-to-use-a-batch-file-to-make-powershell-scripts-easier-to-run/
- rem %~dpn0 evaluates to the drive letter, folder path, and file name (without extension) of the batch file.
- rem PowerShell.exe -Command "& '%~dpn0.ps1'"
- rem Getting around ExecutionPolicy
- rem PowerShell.exe -ExecutionPolicy Bypass -Command "& '%~dpn0.ps1'"
- rem Without Admin access
- PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%~dpn0.ps1'"
- rem With Admin access
- rem PowerShell.exe -NoProfile -Command "& {Start-Process PowerShell.exe -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%~dpn0.ps1""' -Verb RunAs}"
- rem pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement