5

Is there a way I can run a batch file upon locking my computer, and then run another batch file when I unlock it? (Windows 8.1)

Thank you!

intA
  • 393
  • 4
  • 7
  • 15

2 Answers2

4

I am sorry I can't give you english screenshots.
Just create a task in planned tasks.
At the "trigger" tab, you can select "At lock" and "At unlock".

davidbaumann
  • 2,189
  • 1
  • 14
  • 32
  • Is this the view you're talking about? http://i.imgur.com/X6q5iNH.png Where are the triggers? – intA Jan 30 '14 at 00:38
  • If I go to 'create basic task' I eventually get to this screen http://i.imgur.com/gJAvO43.png and there are so many options!! I can't find lock and unlock. – intA Jan 30 '14 at 00:40
  • Not Basic Task. "Create new task". -> Sorry, I don't have an english Windows here. – davidbaumann Jan 30 '14 at 01:04
0

As user294496 pointed out, one of the fastest ways to do this would be to set a "Scheduled Task" up to execute your batch files at lock/unlock.

Another option would be to take a look here and see if this little GUI tool that somebody wrote for something similar might be a better option for you if you don't want to do this using scheduled tasks. If you are interested in writing some C#, I'll bet it wouldn't be too difficult to write a utility similar to this.

sofly
  • 1,346
  • 1
  • 8
  • 6