Automating Computer Tasks

Getting a little frustrated:

I'll explain this in two parts:
1) What manual steps are being taken to perform certain tasks
2) What I want to have happen

Part 1
a) We image computers several times a day every day.
b) We are given image DVD's to use that implement unchangable imaging scripts.
c) Immediately after imaging completes and the computer reboots, we are asked to give the computer name that matches the actual asset tag and set a psssword, but this is okay and we don't need to automate this step.
d) The computer reboots shortly after renaming it and setting the password and then shows the Windows XP login screen.

Part 2
After logging into the computer for the first time, we have to perform several steps manually. It's these steps that I'd like to try and automate somehow.
I'm, unfortunately, not a scripting expert and have spent several hours searching for various prewritten scripts to piece together what I want to use to replace the manual steps we perform on each computer.
Here are the steps:
a) Rename the local Administrator account
b) Add the computer to our domain( computer reboots)
c) Automatically log back into the computer and continue on with the script

After automatically loggin back into the computer, it will continue performing these steps:
d) Prompt for a domain user name, and then add this name to the local Administrator group
e) Login to a network share
f) Run batch files and programs on this share that modify existing programs as well as install new programs.

Sorry, for asking the impossible here, if I am please let me know what I can do at least.

It just seems hard to believe( without knowing a lot about automating computer tasks) that these steps cannot be automatically scripted somehow so that they do not have to be preformed manually for each computer.

Almost ready to punch my fist through the LCD since I'm having such a hard time finding the "right" script for each of these steps.

I find some prewritten scripts that perform some of what I need to do, but most are not exactly what I want...does this mean I have to become a scripting expert, or is there some scripting library that will actually have current good examples that I can easily use?
LVL 19
Rob HutchinsonDesktop SupportAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The Microsoft Windows Deployment Toolkit should be able to accomplish most, if not all of what you're looking for. You can configure it with program installers and scripts, reboots, etc. It makes use of the actual Windows installation media to install, rather than just restore an image, so you only need to store one copy the media for each OS.

More info here:
Rob HutchinsonDesktop SupportAuthor Commented:
We cannot use it. Like I mentioned, we have to use prefabricated imaging DVD's to image these computers. These DVD's are created by another department, and we are not allowed to change these in any way.
Rob HutchinsonDesktop SupportAuthor Commented:
I need something to automate the steps given above, will the Windows Deployment Toolkit let us run scripts to complete the above tasks, or do the tasks I metioned have to be incorporated into the complete installation routine which includes the installation of Windows XP?
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

I'll use an example of my setup. I boot from a generic installation disc created by the toolkit. It has the deployment server and share hardcoded into it. When it loads the preinstall environment, it asks for credentials to connect to the share. Once connected, it brings up a list of available "builds" on the share. For mine, I have XP SP2 and Vista Business. It has a screen for network, and it will let you specify a domain to join, including domain credentials. Then it brings up a list of programs that I set up on the share, like Office, CD burning software, etc. I can pick some or all of the packages. They can be scripts or installation programs, and you can use command line switches (like silent install, etc). After I

I think some of the things you need done may be on the server side, which sounds like it would be handled in a different department. In the individual builds, you can set things like the IE home page, the local admin password, remove games, etc. I've never tried to rename the local admin, but it may be possible. You can also insert reboots into the installation process and add configuration scripts. It gives you a "timeline" type interface for the installation. Once the builds are created on the deployment server, they cannot be changed on the installation side. You pick the build, whether or not you want static or dhcp address, and the computer name, and that's about it, unless you have programs in your installation script that require interaction. If they're all silent, it's pretty much unattended.

Again, it may not do everything you need, but it can definitely do some of it.
Somehow a piece got cut out of my last reply.

After I pick my packages, it goes through the unattended installation, and after the necessary reboots, it starts running the packages I picked. Some are silent, some are scripts, some require me to click through the installation screens. When I'm done, I've got a freshly installed system with all the settings specified by the original build and all the programs I selected.
Rob HutchinsonDesktop SupportAuthor Commented:
"I think some of the things you need done may be on the server side, which sounds like it would be handled in a different department. "

Yeh, can't have this changed.
Guess I'll re-ask this question to see if anyone else can respond.

I understand what you are saying and the methods you are using to get from point-A to point-B, but I cannot start from point-A, and instead have to start between point-A and point-B so I need a solution that will let me do this.
You could float the idea to the other department. If they implemented the deployment back-end, they could set up multiple deployment shares and build the boot discs to point to specific shares that have the corresponding builds. They could customize the builds on their end, and all you would have to do is give the build a name and it would handle all the rest for you without input.
Rob HutchinsonDesktop SupportAuthor Commented:
Umm, I cannot float the idea, the only thing it would do is sink...this is a big company, they have a whole department in charge of making the images, they will not modify the images for us, we have been doing it this way for a long time, I want to get some help with what I asked for...wish I could use your ideas, but I cannnot....
Rob HutchinsonDesktop SupportAuthor Commented:
<WiReDNeT grabs technician's screwdriver and plunges it deep into his LCD sending sparks flying until....ffzzz...blip,blap,,phhzzz....blank screen>
I am sorry that I can't offer any better advice than that already offered by kdtresh, but what I would say in response to your feedback with the rather negative sounding post:

>>> "...this is a big company, they have a whole department in charge of making the images, they will not modify the images for us" <<<

is this:

The larger the company, the more interested in "continuous improvement" it should be.  Indeed, one of the stipulations of the ISO 900x:xxxx certificates given to larger companies is that "Organizations will be required to demonstrate continual quality system improvement."

If you are able to demonstrate to the other department (or to the Quality Department) that there is a stronger possibility of error and massive time wasting by manual inputting of data and fiddling with post-setup configurations when there is a very accurate and streamlined alternative available, and they refuse to act on that to implement a change, then they are half-wits who do not deserve to be working for a "big company".

That's all I have to say, apart from the fact that I feel sorry for you that you are stuck in your situation.
Rob HutchinsonDesktop SupportAuthor Commented:

I agree with you. I've already ordered two more books on scripting, guess I'm going to have to do it the old fashioned way and just learn how to script it myself. Have some example coding from various sources so hopefully it will not be too painful.

Just to give you an example of how convoluted things are:
Normally, to create a network print queue, it takes one Net Admin, less than 5 min.

Our procedures involve contacting two different departments: one in charge of the DNS entries for those printers, and another department in charge of the actual print queue setup on the server hosting the print server queues. The whole process takes no less than 24 to 48 hours to setup =)

So you can see what type of environment I'm working in. Even proposing a change in the image creation would take a meeting of a dozen or more people, and a bunch of testing along with a six month wait time before release of the new images...aarrrggghhh<WiReDNeT falls backwards as the reverse thrust from punching his LCD again, knocks him out of his chair....>
Hi again
Well, I'm glad you have such a rugged monitor, but you must have sore knuckles and be all bruised by now :-)

Ideally, what you would be looking for is a universal CD or DVD from which you can run one or more scripts post-setup to configure and fine-tune everything the way you need it.  The Share folder on the server seems to be the alternative method being prescribed by the company.

It sounds like the department that images the CDs or DVDs is using the standard System Builder utility programs available to create an OEM installation, or at least that's what YOU are really doing when you "restore" the hard drive data from the image.  OEM System Builders are supposed to preinstall Windows in such a way that the end user is presented with an "Out of Box Experience" (oobe) where they then run through a Wizard that allows them to choose (or at least change) the Computer Name, Add themselves as a new user and create other user profiles, choose their time zone and regional settings, create a dialup connection, etc. and then "activate" Windows if it is WinXP and later.

This preinstall of Windows is supposed to show the OEM builder as the contact for Support, and the installation may include non-Microsoft utilities and applications.  I'm not sure if you are fully aware of what is all installed on each "restored" hard drive image, or whether your job is restricted only to the steps you have detailed.

I believe that one of the main stumbling blocks you may have will be your step (f), where several applications need to be setup to run using a batch script.  There SHOULD be utility programs available either from within Windows as installed, or from Admin Resource Packs or Support Tools, that allow most of the configuration up to and including step (e), but there are System Administrators on Experts-Exchange who have a LOT more experience with that particular aspect.  Usually this involves the preparation of "login scripts" fetched at first run as a new user logs into the system.

For the programs and applications that need to be installed, there are a number of methods for doing this that vary slightly or greatly by setup program depending on how the installer packages were intended to run.

You can perform "automated installations" of Microsoft Office and probably also many of the larger applications like AutoRoute by creating a "share" ahead of time and generating a setup instruction file using the appropriate Microsoft utility.

For example, you can install the Office 2003 Resource Kit on a working PC and use the Custom Setup Wizard tool to create a new share from CD to hard drive, load the *.msi file used for the setup, and then complete the single steps in the wizard to generate an *.ini and/or "transform" file that will allow MS Office 2003 to install and create user settings without human intervention (ie. a fully automated setup).

Microsoft Office 2000 to 2007 Resource Kits:

Office 2007 Resource Kit:
The primary administrative tools for deploying the 2007 Microsoft Office system are included with the product and are no longer available as a download as in previous versions Office.

Create a network installation point for Office 2007:

What you really need to become acquainted with are the command line switches for the "Windows Installer" setup routine.

Command-Line Switches for the Microsoft Windows Installer Tool Windows 2000:

For Windows XP:

For Windows Vista:
I don't know, because I don't have the experience with this OS.

Actually, the commands vary between versions of the Windows Installer (msiexec.exe and ancilliary files) rather than between versions of Windows:

A great many Windows Installer-compliant setup packages from larger non-Microsoft software retailers are created using "InstallShield":

Smaller third paty software companies sometimes use other Open Source or cheaper setup packages with which you may have to familiarise yourself in terms of command line switches.  I provided some links in this question:
and will paste the relevant part here in case the asker closes it:

most packages created with "InstallShield" are "Windows Installer" (msiexec.exe) compliant as far as setup switches are concerned.

However, you also have:

1. InstallMaster/Wise Installation System from Wise Solutions - supposed to comply with the standard switches, but sometimes does not:
2. Inno Setup - open source competitor documented here:
3. Nullsoft Scriptable Install System (NSIS) - open source packager:
4. Ghost Installer by Ethalone - commercial packager:
5. Plenty more like "Setup Factory" -

Other methods of creating automated scripts and compiling them into standalone *.exe's is exemplified by AutoIT3:


Windows XP's "iexpress.exe" repackager:

OK, so the actual "package" may allow for standard or company-specific switches, but once the package is opened to the %TEMP% folder, or wherever, the Windows Installer may then be called and other switches may apply that could not have been used on the original package.

For this reason I normally fully unpack setup packages using WinZip, WinRAR, the Extract or Expand commands, and any other means possible to try and establish what's inside.  In some cases the process is governed by a setup configuration file (eg. an *.ini) that is plain text and editable in Notepad.  In other instances it's one of those cheap home-baked "installers" that is nothing more than an outer wrapping for standard Windows Installer files.

You will find a lot of pre-written setup scripts for common software here:

Hopefully this may allow you to at least start looking in the right places when you know what programs and applications need to be installed.  Some software vendors will have details on their support sites like this:
but most won't and you will have to use some of the "unattended" or "silent install" sites for details.

The difficult part of automated installations is knowing whether or not it is vital that the system reboots to instate settings.  As you will be aware, there are a couple of "RunOnce" Registry keys into which a command is written, and this command is activated only once at the next reboot.

It's easy enough when using one of the eg. MS Office Custom Installation Wizard utilities, because you can choose the option to reboot if required.  It won't if it doesn't, and will if it does.  It's that easy.

When you are unsure, and the setup routine doesn't have the option available, you could import the command into the RunOnce registry key and then run a batch command to make a Windows XP (can't verify for 2000 or Vista) computer reboot.

*.INF files can be used to Write or modify Registry values, but you need to know the syntax:

Windows XP (don't know about Vista) has the REG command that can be tuned with the appropriate switches and parameters to modify the registry:

REG /?
REG Operation [Parameter List]


Return Code: (Except for REG COMPARE):
0 - Succussful
1 - Failed

For help on a specific operation type:  REG Operation /?

Not forgetting *.REG scripts themselves.  If you set up a computer the way you want it configured, and then export the registry keys containing the settings that you wish to replicate on other computers, then they an be Imported to the registry on other computers using the commands:

reg import filename.reg
regedit /s filename.reg

For a silent import using the regedit command, add the /s switch as above, and leave it out to be prompted and notified.  It can be a *.txt file also.

Knowing what registry keys and values are helpful, but there are registry monitoring utilities you can use to compare the Before and After registry status when installing programs.  A useful and free program for comparing text-based files side by side is ExamDiff Visual File Comparison Tool by PrestoSoft:

Standalone *.exe:

For corporate and very much extended use, these are excellent tools:
Beyond Compare:

As far as tweaking Windows settings is concerned, then this SHOULD all have been done before the CD Image was created such that you don't have to start messing with the registry for anything other than non-Windows programs and applications.  Nonetheless, you may find a use for TweakUI at some point, so here's the links:

TweakUI for XP:

No such "Microsoft" utility for Vista:

That's just about all I can think of that may at least be of some help, if you weren't already aware already.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I am going to step back from the technical side which we sometimes get lost in.  Let's look at the business side of things and how you can proceed.

(1) Calculate how much time it takes to perform a manual configuration process.
(2) Estimate the average wage rate of the persons performing the tasks.
(3) Multiply steps one and two to get the labor cost per machine.
(4) Estimate the travel costs on average and add that in.
(5) Multiply the sum of three and four to get the total cost per unit.  
(6) Estimate the number of systems per month this process must be applied to and multiply by the result of five.  This is the cost of the current solution.
(7) Repeat the process for your hypothetical solution and compare the results.  Find the cost-savings in your solution and prepare a written proposal for your managers.

This is how I look at problems.  What you are proposing costs money, but it costs less over time than what you are doing.  You, therefore, have a valuable idea for any IT department.  Get the other department involved in line with you and make a name for yourself.

The technical solution has been offered by others (above).  Now it is up to you to be the expert you are and to influence the non-technical leadership in the company.
Thank you WiReDNeT
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Network Management

From novice to tech pro — start learning today.