Re: VB Scripting

From: Mike Kolitz (mikekol_at_idontlikespam.mvps.org)
Date: 04/25/04


Date: Sat, 24 Apr 2004 19:44:21 -0500

Well, you can set the PC to automatically log on as Administrator through
the SYSPREP.INF file.

You can do this with the following entries:

[GuiUnattended]
    AutoLogon=Yes
    AutoLogonCount=1
    AdminPassword="something"
    EncryptedAdminPassword=NO

Just as an example...

But, you said you needed to be logged in as a domain account?
Add this entry to your SYSPREP.INF file as well:

[GuiRunOnce]
    Command0=c:\myscript.vbs

(or wherever you want to put your script.)
This will automatically launch that program/file/script after the PC boots
into Windows.

In that script file, you can set the machine to log in as a domain user on
the next reboot. The code would be similar to the following:

======
dim shell : set shell = CreateObject("WScript.Shell")

shell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon\AutoAdminLogon", "1", "REG_SZ"

shell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon\DefaultDomainName", domainName, "REG_SZ"

shell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon\DefaultUserName", userName, "REG_SZ"

shell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon\DefaultPassword", passWord, "REG_SZ"

shell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon\AutoLogonCount", "1", "REG_SZ"

===========

You should also add code to create a key in
HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce that will run the
install scripts for your programs.

The next step is to reboot the computer, which can be done through WMI, or
by running the SHUTDOWN.EXE command, or by any of your other favourite
methods. Once the computer reboots, it will log in with the information you
provided in the code above.

Hope this helps!

-- 
Mike Kolitz MCSE 2000
MS-MVP - Windows Setup and Deployment
Remember to check Windows Update often,
and apply the patches marked as Critical!
http://windowsupdate.microsoft.com
Protect your PC!
http://www.microsoft.com/security/protect
"Larry" <anonymous@discussions.microsoft.com> wrote in message
news:3d5701c42a52$7815b570$a101280a@phx.gbl...
> Is it possible to automate logging an XP PC onto a domain
> through a VB script.  I would like this script to run
> once after  deploying XP using ghost and sysprep.
> Logging onto this particular acount installs additional
> software(which cannot be installed before imaging) and
> then logs off.
>
> Thanks in advance.


Relevant Pages

  • Re: System Testing (off topic, but)
    ... suppose everyone in the company needs the latest version of ... Java - I could create a script to check the current version and if its old ... then run a script to automate a Java install from the IE browser or network ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Cant run cgi scripts
    ... I answered all the questions during the install. ... After the reboot, I copied a .pl script into one of my ... LogFileManager - The only IIS Logfile Management Tool ...
    (microsoft.public.inetserver.iis)
  • Re: VB Scripting
    ... you can set the PC to automatically log on as ... >(or wherever you want to put your script.) ... >install scripts for your programs. ... >The next step is to reboot the computer, ...
    (microsoft.public.windowsxp.setup_deployment)
  • Re: install_and_reboot target for kernels...
    ... > I'd actually spruce up the script a bit more than that, ... the reason it depends upon install and not just installkernel is that ... reboot vs. shutdown: I don't care, I just normally use shutdown, and ... that we are rebooting to a new test kernel, ...
    (freebsd-arch)
  • Re: cx88 totally fried in 2.6.15-rcX -was- Re: HD3000 - no NTSC via tuner
    ... >> proceedure as it would apply to a working 2.6.14.x kernel. ... My script, fwiw, renames one ... >> The exception being that I understand the Makefile now has an install ... Now the acid test, reboot... ...
    (Linux-Kernel)