Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: turn on guest account via batch file

07 Oct 2009   #1

Windows 7 Ultimate x86
turn on guest account via batch file

Hi, not sure this really belongs to the network forum, but in the absence of a "User account" forum and given that my issue is about the "net user" command, I figured I would post it here.


I have a very weird issue here.

I am trying to enable the guest account via command line and cannot get it to work.

I am using the command "net user guest /active:yes" on Windows 7 Ultimate (and before someone asks, yes I am using elevated administrator rights on the cmd window).
The command is accepted and completes successfully, but when I go see in the Control Panel User Accounts it still says the Guest Account is off.

- Trying on a full, original Windows 7 Ultimate install did not work either (initially I was on a vLited install and I thought it was because of that, but no, it doesn't work with a full install)

What's even more weird is that if I type "net user guest" and look at the info displayed it does show "Account Active Yes", but even after rebooting the Guest account is not displayed on the welcome screen and is still turned off in the Control Panel.

So, it appears it absolutely needs to be turned on via the GUI in the User Account Control Panel. If I turn it on via the control panel and type "net user guest" in a cmd window, the information displayed is exactly the same as before when I attempted to activate the guest account via command line, with one exception: via command line it showed "Last Logon Never" but when turning on the Guest account via Control Panel it shows a logon date after "Last Logon".

I also noticed that after having turned on the guest account via the Control Panel, entering "net user Guest /active:yes" (or /active:no) will work as intended (after rebooting), it just does not work the first time if the account was never activated at least once through the Control Panel. Anyone else can confirm this, and is there a workaround or known solution?

My System SpecsSystem Spec

07 Oct 2009   #2

Win 8 Release candidate 8400


this is totally out of left field but maybe there is a group security policy that by default disables either cmd>netuser or guest account. Might want to take a look in gpedit.msc

Hope this gives you an idea

My System SpecsSystem Spec
07 Oct 2009   #3

Windows 7 x64 finally!

Quote   Quote: Originally Posted by coch View Post
I am trying to enable the guest account via command line
coch, just curiosity: why?
My System SpecsSystem Spec

07 Oct 2009   #4

Windows 7 Ultimate x86

zigzag3143, thanks for the quick reply.
Unfortunately I found nothing in the group policy editor. Besides, the command does complete successfully (I am not prevented from running it), it is just that it does not actually fully activate the account.

wallyinnc, the reason is that I am setting up for unattended Windows 7 install, and I do have an extensive batch file that I run after Windows setup that silently installs all my programs, as well as sets up Windows settings and registry tweaks like I want it, and that includes turning on the guest account.
My System SpecsSystem Spec
08 Oct 2009   #5

Windows 7 x64 finally!

Understood, thanks
My System SpecsSystem Spec
10 Oct 2009   #6

Windows 7 x64 finally!

coch, I have been trying the net user command and searching for solutions, but all I could do is confirm your findings. You can activate or deactivate other accounts, but the Guest account, although it shows active with the net user command, it does not in the GUI.
Microsoft info on the command says it is meant to be run on a server. Maybe that is what is causing the problem?
Two things I found:
- Before running the net user /active:yes command, the Guest account already showed as active via the command, but not in the GUI. So it is not actually changing anything, that seems to be the default condition
- the command will show "completed succesfully" no matter what you do. I typed the parameter wrong once (no "/") and it still showed that.

Sorry I don't have an answer, maybe this helps you find it
My System SpecsSystem Spec
12 Oct 2009   #7

Windows 7 Ultimate x86

wallyinnc, thanks a lot for checking, I appreciate. Does not resolve the issue but at least it does not seem to be something specific to my system. I guess I'll live with it, it's a minor issue anyways.

My System SpecsSystem Spec
12 Oct 2009   #8

Windows 7 x64 finally!

Tks coch.
I actually regreted doing it, because somehow my Admininstrator account got deactivated and the other Admin I had, despite active, had a password that I didn't put there. I had to reset everything. And I truly believe I left them active and didn't touch passwords. This command seems to be trickier than I thought...
Appreciate if you leave us some feedback in case you make progress
My System SpecsSystem Spec
17 Oct 2009   #9

Windows 7 Ultimate x86

Hmmm.. interesting, as far as I know it is not supposed to mess up with passwords at all if typed exactly like I wrote, in fact it is not even supposed to do anything to accounts other than the Guest account. If you are sure you did not do anything else then that's a weird bug indeed.
I still have not found a solution but will post back here if I make progress. for now I am using a partial workaround, which is having my batch file issuing the command "control.exe userpasswords" which opens the uer accounts conotro,l panel from where I can turn on the Guest account manually. At least it saves me from navigating to the control panel manually (yeah, i'm lazy... I reformat often, at least once a month, and I try to minimize the repetitive tasks as much as possible).
My System SpecsSystem Spec

 turn on guest account via batch file

Thread Tools

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:28 AM.
Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33