Home > Batch Scripting, Scripting, Windows > Software rollout… Fancy tools are for girls.

Software rollout… Fancy tools are for girls.

The Re-ip addressing of all the network devices is all but done! the only thing left to do now is to roll out a piece of monitoring software, as the current one uses a local text file pointing to the old IP address. An updated text file needed to be placed on the pc, and a maintenance file to ensure the correct text file was in place needed to be run.

Originally when this software was rolled out we used a group policy to place it on the pc’s. This went well but with the domain we are now on this is no longer possible due to massive restrictions, and limited bandwidth. I coded up a quick solution over the weekend.

I dumped all the laptops, pc’s and workstations names to a text file, i did this by exporting the active directory entries into excel, then cut and pasted the row into a text file. I called this text file machines.txt. This gave me an overview of how many pc’s i needed to do, and it also allowed me to limit the network bandwidth used by doing one location at a time.

I setup an installation source on one of my servers called “inst” and in here, i placed the maintenance exe that will fix the problem. To kick the script off, i used this “kicker” script:

psexec /accepteula @c:\machines.txt -u domain\andrew.morgan -p MYPASSWORD cmd /c “\\kiedna02\inst\maintenance.bat”

This used my credentials to open a command prompt on the remote pc’s in “machines.txt” one by one, and run the script maintenance.bat.


@echo off
net use n: \\kiedna02\inst (maintenance files location)

echo %computername% @ %date% @ %time% >> \\kiedna02\inst\maintenancelog.txt

Runs the tool needed, and logs the installation error level:


echo installation error level %errorlevel% >> n:\maintenancelog.txt

Now if all the above goes to plan, you will end up with the following entry in your maintenance file:

KIEDND-8FGHR2J @ 11/04/2007 @ 11:09:17.20

installation error level 0

Once the file completes you can check for non error level 0’s. And any pc’s missed you can just place them alone in the machines file and run the script again!

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

<span>%d</span> bloggers like this: