Jump to content

Recommended Posts

Posted (edited)

I'm pretty new to this whole "Unattended" scene so maybe the experts will find flaws with this.

Maybe there's other/better/similar ways of doing this but I thought this little util can be very useful for people who do network/DOS based installs of Windows.

Xchange is part of a pack of old DOS utils by Clay Ruth - http://ww2.netnitco.net/users/cruth/download.html It's basically a util that does a find/replaceAll in any file.

I am thinking there's a million and one uses for this XChange util in all stages of the install, but here's a simple example:

At present I have a different unattend.txt file for both my laptop and desktop. The only major difference is the computername & product-key are different - any other changes I make I have to make to both. But now using XChange I only need to have one unattend.txt file which gets modified at install time. I just run laptop.bat to install on my laptop or desktop.bat to install on my desktop, these change a local copy of unattend.txt and then kick off a generic insxp.bat file:

unattend.txt (generic file on the DVD/server)

[userData]

ComputerName=<compname>

ProductKey=<prodkey>

laptop.bat

rem Set the stuff I want to change using the simple set command

set compname=JimsLaptop

set prodkey=AAAAA-11111-AAAAA-11111-AAAAA

insxp

desktop.bat

set compname=JimsDesktop

set prodkey=BBBBB-22222-BBBBB-22222-BBBBB

insxp

insxp.bat

rem Copy my generic unattend file from network folder to local C drive

copy z:\unattend.txt c:\unattend.txt

rem Run xchange to modify the locally copied file based on the variables set earlier

xchange c:\unattend.txt "<compname>" "%compname%"

xchange c:\unattend.txt "<prodkey>" "%prodkey%"

rem Let's go!

Z:\i386\winnt /s:Z:\i386 /u:c:\unattend.txt

All sorts of interesting things can be done with further enhancement and effectively you'd be able to create a install where the user is asked all the questions before the install even starts - "Name?", "Company?", "Do you want to install Windows Games?", "Do you want to install Word?", "I know you are going to answer yes and use Firefox anyway, but you don't like the Firefox loving nerd who made this DVD forcing all his favourite programs onto your machine without your choice. So go on hit Y!?"

These could of course timeout to generic defaults in situations where a real unattended install is required, or for granny's computer all these questions are automatically answered as your batch files worked out they were running on her computer from her macid.

I know many people who don't know too much about computers but get p****d off having control of their machine taken away by a full "Unattended Install For Dummies" that I made for them. I don't like having to remember personalising their username in the unattended file and they don't like having a generic one.

I haven't used them but I am sure Microsoft corporate-based installing software, the unattended sourceforge project and other such things maybe offer similar features but the beauty of this is that it only requires imagination, batch file knowledge and one simple DOS command and not having to learn a new system. As it's all DOS based it's flexible and simple and doesn't rely on servers, Linux or Microsoft Corporate stuff that you somehow obtained.

When you've burned a unattended super-tweaked DVD, taken it to your friends and realised you spelt his username wrong you don't have to wait until XP has installed to modify it, you want to be legal and use his product-key but you didn't know this until after you got to his house. Just typing a basic "set compname=???" or "set prodkey=???" at the command line will fix this and you can kick off the same install without having to hack files or reburn anything.

I did a search for a similar method on this board but didn't find anything, apologies if somebody already thought of this idea.

Edited by jimuk

Posted (edited)

The win32 port of Global Search and Replace (GSAR.EXE) from Linux does this job and it better due to the following:

1. The ability to input search and replace text using ANSI and HexaDecimal codes (very useful for line breaks, carriage returns...etc.)

2. It is a native Win32 program so does not require 16-bit support from Windows XP

Info and download here:

http://gnuwin32.sourceforge.net/packages/gsar.htm

Come to think of it, Linux natively has this utility whereas Windows doesn't...

(Tsk tsk Microsoft, why make batch coders life harder..?)

Edited by ChipCraze23
Posted
4/15/1997 a bit outdated i think. There are other way's to do these things.

I'd be interested in a link, and the "echo" command is very old bust still used!

The win32 port of Global Search and Replace (GSAR.EXE) from Linux does this job and it better due to the following:

I understand a MS-DOS version of this program is available too.

1. The ability to input search and replace text using ANSI and HexaDecimal codes (very useful for line breaks, carriage returns...etc.)

Here too: xchange a:\test.txt "Join^13^10Line" "JoinLine"

2. It is a native Win32 program so does not require 16-bit support from Windows XP

But that was why I wanted a DOS program, as I wanted to be able to configure all these things from the PC's most basic platform, to do it all before the install even started and be able to tweak things at the last minute without having to write to anything.

Posted

Cool tool.

In my CD building tool I have similar functionallity for the unattended file. The parameters you choose will be requested at the beginning of the installation process (right after the CD has booted up).

Screenshot here

In this case the ComputerName value is requested before the process begins. When it is entered, it is merged into the unattended answer file.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...