autometically activate/deactivate user account at scheduled times

  • Thread starter Thread starter favor
  • Start date Start date
F

favor

hi all,

I am new to batch files. I want to create a batch file in Win XP pro
for autometically activating and deactivating an user account at
scheduled days in the week. The program needs to run invisibly. How to
do I do that?

Thanks,
favor
 
Schedule a task (see the "at" command) to, at specified times, run "net user
<username> /active:no" (or /active:yes as appropriate). Running "net help
user" will explain that command more fully. You might also consider
enforcing logon hours rather than periodically enabling/disabling the
account. [... Why? Scheduled tasks, for example, will not run if the
computer is off during the time the task is scheduled to run]

\\ MadDHatteR
 
Back
Top