I've tried setting it up through a scheduled task but I can't get it to work. Also it is running on the local computer so the remote logoff for inactivity in GPO is for terminal services only. If there is another way I haven't found it but I am a little new at this and don't know all the GPO settings.
#shell.ps1New-PSDrive -Name "Y" -PSProvider FileSystem -Root "\\vader\adsapps\ads11_apps" -Persist
& 'Y:\wipt.exe' assembly-out
sleep -s 15
while(get-process wipt*){sleep -s 3}
& 'Y:\wipt.exe' /terminate
logoff.exe
My setup if it helps for the whole picture is we have a plant that uses a bar code system to keep up with the different pieces as it goes through production. The computers we are going to be putting in are Windows 8.1 and they need to be locked down as much as possible. To do so I changed the shell to run powershell and the designated the script to run in a hidden window to launch the program and close when the program is closed. The data is safe from a logoff when the program is open as long as they have completed the scan process on it at the specific computer, which we already do with our TS in place, which we are wanting to get away from. I also need to be able to force a log off on the computer when inactive so that they are not in it at night when reports are ran and they need to be out for them to run. So that's some background on this if it helps. Also, our DC is a Win Server 2008.