turn on guest account via batch file


  1. Posts : 7
    Windows 7 Ultimate x86
       #1

    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 Computer


  2. Posts : 28,845
    Win 8 Release candidate 8400
       #2

    coch

    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

    Ken
      My Computer


  3. Posts : 1,607
    Windows 7 x64 finally!
       #3

    coch said:
    I am trying to enable the guest account via command line
    coch, just curiosity: why?
      My Computer


  4. Posts : 7
    Windows 7 Ultimate x86
    Thread Starter
       #4

    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 Computer


  5. Posts : 1,607
    Windows 7 x64 finally!
       #5

    Understood, thanks
      My Computer


  6. Posts : 1,607
    Windows 7 x64 finally!
       #6

    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 Computer


  7. Posts : 7
    Windows 7 Ultimate x86
    Thread Starter
       #7

    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 Computer


  8. Posts : 1,607
    Windows 7 x64 finally!
       #8

    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 Computer


  9. Posts : 7
    Windows 7 Ultimate x86
    Thread Starter
       #9

    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 Computer


 

  Related Discussions
Our Sites
Site Links
About 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 09:48.
Find Us