erik_demon Posted May 31, 2005 Share Posted May 31, 2005 (edited) Hey everybody I created a little batch file to let you choose your answer file before a format.This file is for those people who install with winnt32.exe (like me )The function of this script is the following:- Find out the drive letter of the Windows XP CD (cd.txt must be on the root of the CD)- Ask the user on which drive he wants to install- Let's the user choose an answer file- formats the choosen drive- Installs XPIn order to use winnt32.exe (32-bit application) we need to use WINPE or BARTPE.Ofcourse I tested this for myself (well, only in CMD not with a format)What is your opinion about the batch file?Is there anyway I can improve this? (my batch skills are not that good, so improvements are welcome)EDIT:NEW VERSION 15/6/2005I added the possibility to create your own winnt.sif (at least part of them)Prepare_windows_install.zip Edited June 15, 2005 by erik_demon Link to comment Share on other sites More sharing options...
genex Posted May 31, 2005 Share Posted May 31, 2005 Lol... very gooderik_demon.Now, only thing I need is a tutorial on how to do this thing. Link to comment Share on other sites More sharing options...
Martin Zugec Posted May 31, 2005 Share Posted May 31, 2005 Hmmm, I am thinking about something similar, but still different HTA application, that will let you choose what you want to change and it will modify winnt.sif. The tool for small companies that are installing computers for clients - they will set everything for unattended installation, but what you cant automate (e.g. company name etc.), they will have ability to set BEFORE installation, not during. So he will run installation, make necessary changes and leave computer. Link to comment Share on other sites More sharing options...
metabaron Posted May 31, 2005 Share Posted May 31, 2005 Here (french compagny), we already do it via a DOS script which set up your unattended install (Windows or Linux, depend on you).Work pretty well ! Link to comment Share on other sites More sharing options...
zxfiles Posted June 3, 2005 Share Posted June 3, 2005 First time poster, because I was looking to do this same task. My plans may differ a little from the original poster.What I'm wanting to do is have the user prompted for some pre-install questions that will edit the winnt.sif file with the appropriate changes. For example, here at the university we use static IPs instead of DHCP. So, having the network settings installed automatically doesn't work too well.I would like to ask the user if he knows the IP address he will be using at the install that day and then it will add it to the winnt.sif file. Make sense? This would help a lot in the network based tasks, because then everything would be configured and I could perform other tasks such as joining the domain and calling install points for Office 2003.As it stands now, I have to install XP under the default workgroup settings with no static IP and configure all of that when the installation completes. After which, I can then perform the network tasks mentioned above. It's not too much of a pain, but I would like to automate as much as possible.Thanks.EditI realize that by doing this, I lose the ability to put the winnt.sif file on the install cd. I would think I would need a boot floppy of some kind that ran a batch file prompting for the answers which in turn would edit the sif file on the floppy. Link to comment Share on other sites More sharing options...
erik_demon Posted June 13, 2005 Author Share Posted June 13, 2005 (edited) Sorry for the late response guys, I have been very busy lately @genexThanks, about that turtorial. The most import thing is that you understand how to set user imput:SET Choice=SET /P Choice="Is this correct? (Y/N) "IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%IF /I '%Choice%'=='Y' (GOTO Choose_user)IF /I '%Choice%'=='N' (GOTO Install_drive)I find it hard to explain this because I don't know eveything about this to SET /P Choice holds the batch file and asks user imput. If you type Y the variable %Choice% is equal to Y. After this, we use IF to check the value and execute a command (in this case: Goto Choose_user)That is the most important. If you would like you can change the variable name. You can test it like this:@ECHO OFFSET Option=SET /P Option="Select an option: (1 or 2) "IF NOT '%Option%'=='' SET Option=%Option:~0,1%IF /I '%Option%'=='1' (ECHO.ECHO You Selected option 1PauseGOTO end)IF /I '%Option%'=='2' (ECHO.ECHO You Selected option 2PauseGOTO end):endI hope this helps@Martin ZugecGood idea! Since I use BARTPE, I believe .HTA support is avaiable. About the support for companies, check out below@metabaronThat's great, Would you like to share it?@zxfilesHi welcome I think I found what you where looking for (and I was looking for it to )Check-out this postI tested it, and with this method you can created specific parts for your winnt.sif Edited June 13, 2005 by erik_demon Link to comment Share on other sites More sharing options...
erik_demon Posted June 15, 2005 Author Share Posted June 15, 2005 (edited) New version available (see first post)This version is written for my system, so if you want to use it, you need to modify it.Since my batch skills are not that great, it may be that parts of the script can be optimized. If you see such a part, please comment I tested it and for my system it works great EDIT:For the winnt.sif creator, credits go to gunsmokingman who designed it (see the link in post nr. 6 )Thanks Edited June 15, 2005 by erik_demon Link to comment Share on other sites More sharing options...
drache Posted June 22, 2005 Share Posted June 22, 2005 what would be really cool is if there are a few winnt.sif files that have most of the answers. now, the sif file would will have to be loaded into memory at some point in time right, so why not have it make the changes to the sif file in memory. that way there wouldnt be a need for a floppy. i dont know how this could be mananged, but i think it would be really cool.either that or a sif file somewhere on the network so it can be changed depending on how the user answers Link to comment Share on other sites More sharing options...
Yzöwl Posted June 22, 2005 Share Posted June 22, 2005 Other than the optimising, you suggest may be required, how are you both 'echoing to' and 'deleting from' the optical disk drive? Link to comment Share on other sites More sharing options...
Yzöwl Posted June 29, 2005 Share Posted June 29, 2005 erik Link to comment Share on other sites More sharing options...
erik_demon Posted June 29, 2005 Author Share Posted June 29, 2005 (edited) sorry for the late answer, I didn't pay attention to the topic I do not completely understand what you mean: how are you both 'echoing to' and 'deleting from' the optical disk drive?I believe that you think that I use this for a CD based installed, correct?If you mean that, it will not work. I install my computer from a second harddrive. On that drive, I can write and delete as much as I like. You are correct when you say that this won't work with a CD install.However...If you change the batch file like this:ECHO AutoPartition=1 >>%CDROM%WINNT.SIFtoECHO AutoPartition=1 >>A:\WINNT.SIFthe winnt.sif will be written to a Floppy disk. Then you could modify the batch file to let winnt32.exe find the answer file thereI hope this helps Edited June 29, 2005 by erik_demon Link to comment Share on other sites More sharing options...
Yzöwl Posted June 29, 2005 Share Posted June 29, 2005 This version is written for my system<snip>I tested it and for my system it works greatIffor %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\cd.txt set CDROM=%%i::Install_driveclsECHO Your CD-rom drive is: %CDROM%thenif exist %CDROM%WINNT.SIF DEL %CDROM%WINNT.SIFping -n 1 127.0.0.1>nulrem ---------------------------------------------rem WRITE NEW ANSWER FILErem ---------------------------------------------ECHO;SetupMgrTag >>%CDROM%WINNT.SIF<snip>You are deleting from and echoing to the optical drive, therefore how did you test it? Link to comment Share on other sites More sharing options...
erik_demon Posted June 29, 2005 Author Share Posted June 29, 2005 (edited) @YzöwlYou have a point here, this is my misstake. I will explain it My unattended structure at home is so that I am able to install from a CD, from a second harddisk and from a network share.To not complicate things, to keep everything simpel, I work with only one variable. This variable is %CDROM%. In my test the file called cd.txt was on my second harddrive ( D:\ ) therfore this harddrive is seen as %CDROM% and the batch file will tell you Your CD-rom drive is: D: I understand your confusion completely an when I get back from vacation (ah finally ) I will change it, because like you stated, it is not possible to write or delete to the optical drive. Edited June 29, 2005 by erik_demon Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now