Tested on Win 7 HP 32,64 - Win 7 Ent 32,64
If you are running tests, then it means you re-log on when next test phase starts.
So just assign via TASK SCHEDULER, a LOGON trigger to run a script during LOGON, and assign as SYSTEM user so it runs in background. Just save the below Sample TASK as XML file, and edit the source :
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2016-08-17T08:16:28.8123508</Date>
! <Author>DOMAIN\USER</Author>
! <Description>Your description</Description>
</RegistrationInfo>
<Triggers>
<LogonTrigger>
<Enabled>true</Enabled>
</LogonTrigger>
</Triggers>
<Principals>
<Principal id="Author">
! <UserId>S-1-5-18</UserId> -> This is SYSTEM user ID
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>StopExisting</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
<UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>P3D</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
! <Command>C:\cleanup.bat</Command> This is where your script resides
</Exec>
</Actions>
</Task>
I'm confused, why can you not use the methods listed in https://technet.microsoft.com/en-us/library/cc753404.aspx again on the Group Policy configuration by setting that policy and pointing it to a script for LOGOFF or SHUTDOWN on most of your machines? These policies can be set locally with
– Pimp Juice IT – 2016-10-10T05:52:34.963gpedit.msc
and not just via a domain environment. You have a link to this via one of the other links in your question?This feels like something one would use snapshots and/or a read only drive for. – Aibobot – 2016-10-10T08:06:02.563
@Homey_D_Clown_IT - I think you cited the same article I cited. As I stated in the question, this is a stand alone workstation; and not a member of a domain. I don't have a domain controller or netlogon folder. Follow the links and read the instructions: "In Script Name, type the path to the script, or click Browse to search for the script file in the Netlogon shared folder on the domain controller." – jww – 2016-10-10T09:35:39.280
@jww Did you try to assign a local path to see what happens? – Seth – 2016-10-10T09:40:21.907