diff --git a/README.md b/README.md index 3bb8d3a..ed275a2 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,16 @@ It is notably used on the Microsoft Surface line of products, as well as many ot Each command does only one thing, and there is no GUI interface. To use: 1. Download and unzip. Does not have an installer 2. Select file -2. Right-click, Select: "Run as Administrator" -3. Enter administrator password if prompted -4. Reboot - -:warning: **MUST RUN AS ADMINISTRATOR** :warning: +3. If you're running `get-status.bat` you don't have to run as admin, otherwise: +4. Right-click, Select: "Run as Administrator" +5. Enter administrator password if prompted +6. Reboot To check the status of DPST: * `get-status.bat` +:warning: **MUST RUN AS ADMINISTRATOR** :warning: + To disable DPST: * `disable-dpst.bat` diff --git a/dpst-control.ps1 b/dpst-control.ps1 index ab3812d..02dd8f3 100644 --- a/dpst-control.ps1 +++ b/dpst-control.ps1 @@ -127,12 +127,6 @@ If( $Debug ) { $DebugPreference = "Continue" # Enable debug output } -# This script must run as admin -If( !(RunningAsAdmin) ) { - Write-Error "Must run as Administrator!" - Exit 255 -} - # Search registry for FTC entry $ftcPath = LocateFTC -regPath ${regBase} If( $ftcPath -eq $false ) { @@ -184,11 +178,17 @@ Else { Exit 1 } Else { - Write-Output "DPST is disabled" + Write-Output "DPST is disabled" Exit 0 } } +# This script must run as admin if the value is going to be overwritten +If( !(RunningAsAdmin) ) { + Write-Error "Must run as Administrator!" + Exit 255 +} + # Write new value to registry and report results If( $ftcNew ) {