+ Post New Thread
Results 1 to 5 of 5
Scripts Thread, vbsscript for auto login in Coding and Web Development; Hi Wrote this script at home and worked perfectly , but when trying to use it on a windows 7 ...
  1. #1
    rckngslnd's Avatar
    Join Date
    Nov 2010
    Location
    Margate
    Posts
    47
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    vbsscript for auto login

    Hi

    Wrote this script at home and worked perfectly , but when trying to use it on a windows 7 PC on the domain it will not write to HKEY_LOCAL_MACHINE but when i change the hex key can get it to write to the HKEY_CURRENT_USER. Please could anyone give an ideas in why this does not work?? Please see code below


    const HKEY_LOCAL_MACHINE = &H80000002
    strComputer = "."
    Set StdOut = WScript.StdOut

    Set oReg=GetObject("winmgmts:{impersonationLevel=imper sonate}!\\" &_
    strComputer & "\root\default:StdRegProv")

    'set path for autologin
    strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"

    'setting default username
    strValueName = "DefaultUserName"
    strValue = "08student"
    oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValu e


    'setting password
    strValueName = "DefaultPassword"
    strValue = "password"
    oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValu e

    'setting domain
    strValueName = "DefaultDomainName"
    strValue = "Windows-media"
    oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValu e

    'enabling auto login, set 1 to enable and 0 to disable
    strValueName = "AutoAdminLogon"
    strValue = "1"
    oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValu e

  2. #2
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,612
    Thank Post
    95
    Thanked 115 Times in 111 Posts
    Rep Power
    42
    What's the error you get? and I assume that its just a typo on this thread that all strValue variables have a space in it 'strValu e'?

  3. #3
    rckngslnd's Avatar
    Join Date
    Nov 2010
    Location
    Margate
    Posts
    47
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by apeo View Post
    What's the error you get? and I assume that its just a typo on this thread that all strValue variables have a space in it 'strValu e'?
    Hi

    Yes that was typo in the thread, the thing is i'm not getting an error it seems to run fine but no registry entries have been added

  4. #4
    rckngslnd's Avatar
    Join Date
    Nov 2010
    Location
    Margate
    Posts
    47
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Look like it UAC blocking it, thanks for anyone that tried to help

  5. #5
    rckngslnd's Avatar
    Join Date
    Nov 2010
    Location
    Margate
    Posts
    47
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I tried ti today works perectly when i tempory disable UAC, hope this helps any someone else with similar problem

SHARE:
+ Post New Thread

Similar Threads

  1. [MDT] Auto Login as Administrator
    By deano in forum O/S Deployment
    Replies: 5
    Last Post: 7th October 2010, 12:49 PM
  2. Grid Club Auto-Login
    By in forum Educational Software
    Replies: 7
    Last Post: 3rd February 2010, 05:01 PM
  3. Auto Login - Lock Keyboard and Mouse
    By Zoom7000 in forum Windows
    Replies: 7
    Last Post: 26th August 2009, 12:57 PM
  4. Auto Login with a windows account
    By timbo343 in forum Windows
    Replies: 10
    Last Post: 7th November 2007, 03:44 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •