Table of Contents
MS win98 / NT4 setup automation
Background
Embarasing as it is to have to recount, once upon a time I was responsible for a network of mostly windows 98, NT and XP workstations. In my defence, it was 20 years ago. Even back then, I hated the windows admin way of installing things manually via a GUI. Time consuming, error prone and inconsistent is not a way to manage computers.
Using the limits enforced by DOS, I was able to automate many aspects of an install, many installers could be invoked via the CLI and fed options rather than the point and click GUI way.
Below is a script to automate this, probably very much out of date and could be written much better. The Zip file contains the contents of the install floppy disk, (this needed to have DOS installed of course).
There are other parts of this which I have not mentioned here, the files are downloaded from an internal FTP server, and it relies on reverse DNS being set up, we tended to use static IP for desktops and then have a dhcp scope for laptops and visitors to use. To allow web proxy access, it used a proxy.pac file pointed to by a WPAD.DAT file, these are documented well elsewhere, so I will not mention these further. This was the original page:- http://www.mediahub.co.uk/support/downloads/pcinstaller/
Code
README.TXT
Workstation setup disk. ======================= Author:- Andrew Stringer "andrew at mediahub.co.uk" Purpose. -------- This disk is developed to setup a windows 98 or xp computer with the applications and settings required for the Birmingham city council Employment Resource Centre network. Features. --------- Sets ip address, subnet mask and default router from arguments passed from the command line on xp/2000 only. Downloads required applications from internal ftp server. Runs install programs and passes required setup parameters where possible. Useage. ------- For win98:- a:\start-win32.bat No command line arguments. For xp/2000:- a:\start-winnt.bat 172.25.x.x 172.25.x.1 The first ipaddress is the required ipaddress of the host, the second is the address of the default router. A subnet mask is assumed of 255.255.255.0 This could be changed easily. If no ipaddress is given, the ip settings are left alone. Technical description. ++++++++++++++++++++++ Below is a commented description of the code. rem clear screen and disable echo @echo off cls rem set colour to black/green, just for readability and I like it. rem This is reset at the end to act as an aid to when it is finished. color 0A rem set title title ERC network setup. rem test if ip parameters have been passed to batch file. If rem two parameters have not been passed, the ipaddress setting is skipped. if %2!==! goto newdir rem netsh (the NETwork SHell) allow command line setup of certain parameters rem first set the device name to something sensible (eth0), spaces rem do not belong in device names, they are delimiters. Also this serves as rem a check to see if the computer was set up with this script :-) netsh interface set interface name="Local Area Connection" newname="eth0" echo Setting ipaddress to %1, subnetmask to 255.255.255.0 and gateway to %2 and eth0. rem do the actual address setup netsh interface ip set address "eth0" static %1 255.255.255.0 %2 1 echo Setting DNS.... rem set up the first (internal) dns server netsh interface ip set dns name="eth0" static 172.25.0.7 none echo and adding extra dns server. rem add a second netsh interface ip add dns name="eth0" 62.232.4.232 2 echo and adding WINS server for crappy name resolution netsh interface ip add wins name="eth0" 172.25.0.9 rem note that ms have thoughtlessly not provided a way to set the workgroup name, rem this has to be done manually *after* a reboot. Typical.... rem wsname is an external utility on the floppy which allows the rem computer name to be set from PTR dns records. This relies of course on the rem name space being populated..... echo Setting computer name from reverse DNS. wsname /N:%DNS:172.25.0.7 rem finish off the ip phase by echoing the config. echo Current ip settings. echo. ipconfig /all echo. rem start the next phase by creating some new directories to download stuff to. :newdir echo Making new directories, c:\novell and c:\downloads. mkdir c:\downloads mkdir c:\novell rem Get the files! rem this uses ftp from an internal server, all the commands are in commandsnt.txt rem The contents are:- rem rem open 172.25.0.20 rem binary rem lcd c:\novell rem get novell-nt-xp-v49sp2e.exe rem lcd c:\downloads rem get xp-settings.zip rem get winzip81.exe rem get notes5010.zip rem get moz1.7.1-installer.zip rem get acrobat60-msi.zip rem bye :ftp echo. echo Starting ftp download from ftp://enterprise.mediahub.co.uk. ftp -s:commandsnt.txt -A rem Unzip some files. The unzip utility is a command line win32 compilant rem unzipper. Why does nt not have a useable, scriptable unzipper? rem -d option sets the destination directory. rem the novell client .exe is really a self extracting zip file, so it can be rem unzipped rather than run. :unzip echo Unzipping Novell client 4.9sp2e. a:\unzip c:\novell\novell-nt-xp-v49sp2e.exe -d c:\novell echo. echo Unzipping Notes 5.0.10 client. a:\unzip c:\downloads\notes5010.zip -d c:\downloads\notes5010\ rem Lotus Notes can be installed silently following the instructions given rem of the installshield web site using an .iss file. The one in use is rem notes-nt.iss, this should install the uk dictionary files rem Note that Notes is only installed *NOT* configured during this. rem You will have to configure it manually. :notesinstall echo Starting silent install of Notes 5.0.10, nothing will be displayed on screen. c:\downloads\notes5010\setup.exe -s -f1a:\notes-nt.iss echo Finished Notes 5.0.10 install. rem Start the Novell Client install rem This uses the automatic client upgrade (acu.exe) rather than the setup.exe rem This allos us to have a modified acu.ini file which sets the tree, server and slp rem parameters. Context cannot be set here because it varies depending on the site. rem The old acu.ini is renamed, not that it ever gets used again. echo. echo. echo Installing Novell wnt/2k/xp v4.9sp2e client. ren c:\novell\English\WINNT\i386\acu.ini acu-ini.old copy a:\acu.ini c:\novell\English\WINNT\i386\ C:\novell\English\WINNT\i386\acu.exe /U:a:\confignt.txt echo. echo. rem start to install some applications rem Acrobat has a .msi installer wrapped in the .exe file, I have unwrapped the rem .msi in order to do a silent install. I am not bothered about keeping rem this up to date because Acrobat 6 onwards checks itself and prompts for an rem update. :acrobat echo Starting install of Adobe Acrobat Reader 6.0. mkdir c:\downloads\acrobat60 c: cd downloads\acrobat60 a:\unzip c:\downloads\acrobat60-msi.zip msiexec /i "c:\downloads\acrobat60\Adobe Reader 6\Adobe Reader 6.0.msi" /qb-! rem Deliver a standards compliant, secure, easy to use and configurable broswer rem to allow the user to upgrade from internet exploiter / lookout! express. rem This will be changed to Firefox soon because it is even easier to use :mozilla echo Starting Mozilla Install mkdir c:\downloads\mozilla\ cd c:\downloads\mozilla a:\unzip c:\downloads\moz1.7.1-installer.zip setup.exe rem This next section uses a preconfigured user profile and copies rem it into the sefault user profile. This sets up a consistant rem interface and sets proxies for ie. rem Also, the systemwide proxy.pac *should* set these but ie seems not to care to use it. ff does. :profile echo. echo Create temp dir... rem expand xpsetup.zip default user profile settings mkdir c:\downloads\temp echo Unzip xp settings to temp dir... a:\unzip.exe c:\downloads\xpsetup.zip -d c:\downloads\temp\ echo Save old settings.... xcopy /Y /K /H "C:\Documents and Settings\Default User\*.*" "C:\Documents and Settings\Default User\old\*.*" echo Copy updated settings.... xcopy /Y /K /H c:\downloads\temp\*.* "C:\Documents and Settings\Default User\*.*" echo Done. rem finish off by reseting console colours and playing a noise to alert dozing operators! rem Sayit is an external utility on the floppy used to put a box on the screen with rem actions to be performed. Computer is rebooted. rem Upon reboot, log in to the workstation only first to set workgroup and NDS context, then reboot again rem and again and again until you're sufficiently pissed off. Well this is windows after all... :end rem reset console colours color 07 rem make beep rem echo rem echo START/min sndrec32 /play /close %windir%\media\ding.wav a:\sayit Remember to set the workgroup name, Mozilla Proxies and set up a Sophos account. rem start reboot of machine shutdown /R a:
This page has been accessed:-
Today: 1
Yesterday: 0
Until now: 72