Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO Installing DisplayENVI.....
- @echo Off
- REM powershell -command "& {Set-ExecutionPolicy Restricted}"
- powershell -command "& {$a=Get-ExecutionPolicy;if ($a -eq 'Restricted') {Exit 2} else {exit 1}}"
- if %errorlevel% EQU 1 Goto :CONTINUE
- REM if %errorlevel% EQU 1 ExecutionPolicy is Restricted : needs to be authorised
- @ECHO Resetting PowerShell Script Execution Policy to RemoteSigned......
- powershell -command "& {Set-ExecutionPolicy Remotesigned}"
- REM Confirm Policy was reset
- powershell -command "& {$a=Get-ExecutionPolicy;if ($a -eq 'Restricted') {Exit 2} else {exit 1}}"
- if %errorlevel% EQU 1 Goto :CONTINUE
- ECHO ##########################################################
- ECHO ## DisplayENVI Error. ##
- ECHO ## Failed to change Powershell script execution policy ##
- ECHO ## ##
- ECHO ## Try: ##
- ECHO ## Right-click on DisplayENVI.bat, Run As Administrator ##
- ECHO ## OR: ##
- ECHO ## Seek Help from application support ##
- Echo ##########################################################
- Pause
- GOTO :EOF
- :CONTINUE
- START Powershell -File .\DisplayENVI.ps1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement