1. Found a nice trick to force waiting for a shutdown or startup script using just gpedit.msc.
i haven't tested how long these cmds will wait,but they start before logon in startup and after desktop disappears on shutdown..
[EDIT: seems it does run scripts, but i can't get it to wait for recording completion..]
Startup/Shutdown Scripts:
1.) Start, Run, gpedit.msc
2.) Select Computer Configuration, Windows Settings, Scripts (Startup/Shutdown)
3.) Double Click Shutdown
4.) Click Add, and browse to the script.
5.) Click OK, and OK again.
6.) Close Group Policy.
7.) The script should now be run on shutdown.
it just adds an entry tolike:
[Shutdown]
0CmdLine=C:\test.exe
0Parameters=
but probably best to just use gpedit.msc...
2. Pause Suspend to Run Script
Anybody interested in a little util i wrote, that intercepts suspend, and runs script with as much time as you want, say to kill a problematic device with devcon, then continues suspend...upon resume, it can run another script/cmd...[to restart device,etc]
basically it just cancels the suspend completely, runs script/exe/whatever, then resumes suspend, not blocking it this time...
Attached program pauses suspend request till a program or script is run, then suspends, and can optionally run another command upon resume...
my script is still pretty rought but it works great..
it doesn't intercept the 'suspend' from settings menu tho, Sub forces the suspend....
use a normal suspend cmd to do it yourself from a custom menu item..
[i'll build in a suspend function later]
the second param is optional, but first one isn't..[cmd to run at suspend]
SuspDeny.exe "CmdToRunAtSuspend" "CmdToRunOnResume"-[Optional]
it runs invisibly...pause to exit..
run with no params to see help..
i haven't tested how long these cmds will wait,but they start before logon in startup and after desktop disappears on shutdown..
[EDIT: seems it does run scripts, but i can't get it to wait for recording completion..]
Startup/Shutdown Scripts:
1.) Start, Run, gpedit.msc
2.) Select Computer Configuration, Windows Settings, Scripts (Startup/Shutdown)
3.) Double Click Shutdown
4.) Click Add, and browse to the script.
5.) Click OK, and OK again.
6.) Close Group Policy.
7.) The script should now be run on shutdown.
it just adds an entry to
Code:
%windir%\system32\GroupPolicy\Machine\Scripts\scripts.ini
[Shutdown]
0CmdLine=C:\test.exe
0Parameters=
but probably best to just use gpedit.msc...
2. Pause Suspend to Run Script
Anybody interested in a little util i wrote, that intercepts suspend, and runs script with as much time as you want, say to kill a problematic device with devcon, then continues suspend...upon resume, it can run another script/cmd...[to restart device,etc]
basically it just cancels the suspend completely, runs script/exe/whatever, then resumes suspend, not blocking it this time...
Attached program pauses suspend request till a program or script is run, then suspends, and can optionally run another command upon resume...
my script is still pretty rought but it works great..
it doesn't intercept the 'suspend' from settings menu tho, Sub forces the suspend....
use a normal suspend cmd to do it yourself from a custom menu item..
[i'll build in a suspend function later]
the second param is optional, but first one isn't..[cmd to run at suspend]
SuspDeny.exe "CmdToRunAtSuspend" "CmdToRunOnResume"-[Optional]
it runs invisibly...pause to exit..
run with no params to see help..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie