Skip to content

Instantly share code, notes, and snippets.

@alimbada
Last active August 23, 2019 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alimbada/14890ddae930eeb71b21ea085dcfffe8 to your computer and use it in GitHub Desktop.
Save alimbada/14890ddae930eeb71b21ea085dcfffe8 to your computer and use it in GitHub Desktop.
Empty Standby List Scheduled Task
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2019-08-22T13:32:01.0996741</Date>
<Author>.\Ammaar.Limbada</Author>
<URI>\Ammaar.Limbada\Empty Standby List Scheduled Task</URI>
</RegistrationInfo>
<Triggers>
<TimeTrigger>
<Repetition>
<Interval>PT1H</Interval>
<StopAtDurationEnd>false</StopAtDurationEnd>
</Repetition>
<StartBoundary>2019-08-23T10:00:00</StartBoundary>
<ExecutionTimeLimit>PT30M</ExecutionTimeLimit>
<Enabled>true</Enabled>
</TimeTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-18</UserId>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>true</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>true</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>powershell.exe</Command>
<Arguments>-Command "If((Get-Counter '\Memory\Free &amp; Zero Page List Bytes').CounterSamples.CookedValue -lt 4000000000){ C:\Users\ammaar.limbada\bin\EmptyStandbyList.exe standbylist }"</Arguments>
</Exec>
</Actions>
</Task>
@alimbada
Copy link
Author

Requires EmptyStandbyList.exe (see https://wj32.org/wp/software/empty-standby-list/) to be in a location that is in the user's PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment