Chapter 14. Managing Computer and User Scripts

Automation is the key to Windows scripting. The previous chapter showed how you can create scripts to run automatically based on the time, day of the week, or date. This chapter focuses on creating scripts that execute based on user logon and logoff, as well as computer startup and shutdown.

Why Use Computer and User Scripts?

Every once in a while, an administrator or user asks "Why would I want to use computer and user scripts?" I always think back to my days in the military when I often needed to logon to a system and be able to immediately begin troubleshooting critical network problems in a real-time environment. I simply didn't have time to start all the tools I needed, run background checks, or perform any other setup tasks, so I automated these processes. When I logged in, the tools I needed to work with started automatically, the background checks initialized and began running, and other configuration tasks were executed as well. The result was that instead of it taking five or six minutes to get ready to troubleshoot, I could start immediately, which helped me earn a reputation as someone who could resolve problems quickly.

While seconds may not count in the environment you work in, you can certainly benefit from automation. Any routine tasks that you or others in your office ...

Get Microsoft® PowerShell, VBScript and JScript® Bible now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.