Tag Archives: logon

Enable or Disable a user account from command prompt

Posted on .

In a domain environment you can enforce logon times for individual users, I wanted to emulate this behaviour in a workgroup.

To do this first I learnt the following commands in command prompt [cmd] (run as Administrator):

To disable: net user Bob /active:no
To enable: net user Bob /active:yes

I then created 2 tasks in Task Scheduler to disable and enable at the appropriate times.

When creating the tasks its important to note:

  • Run with highest privileges
  • Run even when user not logged on
  • The path to the “net” command is “C:\Windows\System32\net.exe”
  • The rest of the command line goes in the arguments box

This helped to discourage my son from waking up at 4am to play Plants vs Zombies™ on the computer.

Administrative Rights on Startup/Logon in Vista

Posted on .

The new User Access Control (UAC) in Windows Vista is an interesting feature. Whilst it keeps me well informed as to the security status of each program I run, it can become a hinderence to productivity.

One such issue I am having is loading programs at startup that require Administrative Rights. Currently Vista will not allow an elevated program to run on startup via the usual methods. But there is a work around using the Task Scheduler as I found on the Lavalys forum.

In order to create a task which runs with admin rights, you need to be logged in as an Administrator. These steps will not allow you to run an elevated program if you don’t already have the rights to do so.

  1. Open Task Scheduler by pressing the Start button and typing task scheduler and pressing enter.


  2. Create a new Task through the Action menu.


  3. Choose a name for the Task, and make sure Run with highest priveleges is ticked.


  4. Choose Triggers from the tabs at the top, and click New.


  5. Choose At log on from the Begin a task option.


  6. Either pick a user, or choose “Any user” if you want this to run on log on for everyone. Make sure everything else is not ticked except for “Enabled”. Click OK.


  7. Choose Actions from the tabs at the top, and click New.


  8. Click the Browse button and find the program you want to load at logon/startup. In the Lavalys example it would be the Everest executable. Click OK.


  9. Click the Settings tab and make sure the only checkbox ticked is Allow task to be run on demand.


  10. Click OK again to save your new task. Check it has been created properly by clicking on Task Scheduler Library on the left pane of the Task Scheduler. Thats it, you’re done. Reboot and see if it works!