Advertisement
Seeker

DisplayENVI.bat

Sep 11th, 2011
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.25 KB | None | 0 0
  1. @ECHO Installing DisplayENVI.....
  2. @echo Off
  3. REM powershell -command "& {Set-ExecutionPolicy Restricted}"
  4. powershell -command "& {$a=Get-ExecutionPolicy;if ($a -eq 'Restricted') {Exit 2} else {exit 1}}"
  5. if %errorlevel% EQU 1 Goto :CONTINUE
  6. REM if %errorlevel% EQU 1 ExecutionPolicy is Restricted : needs to be authorised
  7. @ECHO Resetting PowerShell Script Execution Policy to RemoteSigned......
  8. powershell -command "& {Set-ExecutionPolicy Remotesigned}" 
  9. REM Confirm Policy was reset           
  10. powershell -command "& {$a=Get-ExecutionPolicy;if ($a -eq 'Restricted') {Exit 2} else {exit 1}}"
  11. if %errorlevel% EQU 1 Goto :CONTINUE
  12. ECHO ##########################################################
  13. ECHO ## DisplayENVI Error.                                   ##
  14. ECHO ## Failed to change Powershell script execution policy  ##
  15. ECHO ##                                                      ##
  16. ECHO ## Try:                                                 ##
  17. ECHO ## Right-click on DisplayENVI.bat, Run As Administrator ##
  18. ECHO ## OR:                                                  ##
  19. ECHO ## Seek Help from application support                   ##
  20. Echo ##########################################################
  21. Pause
  22. GOTO :EOF
  23. :CONTINUE
  24. START Powershell -File .\DisplayENVI.ps1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement