ElMonty Posted February 5, 2004 Share Posted February 5, 2004 Hi pple!Fistly i must thank hysel for the code he posted a couple days ago, it was my inspiration I made my own with some more features (not too much): create a bit customized winnt.sif, create the ISO and burn itSo the batch is supposed to create a winnt.sif with personal name, organization, PCname and favourites list (XP serial too of course). Then it creates a users.cmd file with the customized users (here the main work is from hysel) and finally it creates an ISO and burn it.To get the file working correctly the batch has to be placed on C, you need a folder called "Files" with CDImage.exe and cdburn.exe. INSIDE the folder you need another folder called "CD" with your Unattended CD files.This is important: you have to get the users.cmd configured in your own unattended CD, running when you want, but remember to call the file Winnt.sif is copied to BOOT folder (with the structure folder above) and users.cmd is copied to c:\files\CD\$OEM$\$1\PostInstall\Ive almost done my completed unattended CD, so i created one with only the hotfixes for my friends and family. This batch is made to get an easy way to personalize their CDsIt is not as good as XPCreator or XPInstall but I did what i can and my time allows. Ive just translate the file, but if anyone wants an spanish version i can post it too Please check my translation, i hope it wont make the file fails. Here is the code:CLS@ ECHO OFFTITLE Windows XP Personal EditionCOLOR 0FECHO.ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»ECHO º ºECHO º Welcome to the Windows XP Personal Edition Creator ºECHO º ºECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼECHO.ECHO Stage I: WinNT.SIF creationECHO Stage II: Users.cmd creationECHO Stage III: WXPUltraOEM.iso creation and burningECHO.pauseCLSECHO.ECHO Stage I: WinNT.SIF creation ECHO îîîîîîîîîîîîîîîîîîîîîîîîîîîîî:BACK1ECHO [Data]>> WinNT.SIFECHO AutoPartition=0 >> WinNT.SIFECHO MsDosInitiated="0" >> WinNT.SIFECHO UnattendedInstall="Yes" >> WinNT.SIFECHO [unattended] >> WinNT.SIFECHO Repartition=No >> WinNT.SIFECHO UnattendMode=FullUnattended >> WinNT.SIFECHO OemSkipEula=Yes >> WinNT.SIFECHO OemPreinstall=Yes >> WinNT.SIFECHO TargetPath=\WINDOWS >> WinNT.SIFECHO UnattendSwitch="yes" >> WinNT.SIFECHO WaitForReboot="No" >> WinNT.SIFECHO DriverSigningPolicy=Ignore >> WinNT.SIFECHO KeyboardLayout="Espa¤ol" >> WinNT.SIFECHO DriverSigningPolicy=Ignore >> WinNT.SIFECHO Hibernation=No >> WinNT.SIFECHO IncludeCatalog=KB826939.cat >> WinNT.SIFECHO [GuiUnattended] >> WinNT.SIFECHO AdminPassword=* >> WinNT.SIFECHO EncryptedAdminPassword=NO >> WinNT.SIFECHO OEMSkipRegional=1 >> WinNT.SIFECHO TimeZone=105 >> WinNT.SIFECHO OemSkipWelcome=1 >> WinNT.SIFECHO [userData] >> WinNT.SIFECHO.ECHO Type your Windows XP serial numberECHO.SET /P serial=Serial: ECHO ProductKey=%serial% >> WinNT.SIFECHO.ECHO Type your name, organization and PC NameSET /P name=Name: SET /P org=Organization: SET /P PCName=PC Name: ECHO FullName="%name%" >> WinNT.SIFECHO OrgName="%org%" >> WinNT.SIFECHO Computername=%PCName% >> WinNT.SIFECHO [Display] >> WinNT.SIFECHO BitsPerPel=32 >> WinNT.SIFECHO Xresolution=1280 >> WinNT.SIFECHO YResolution=960 >> WinNT.SIFECHO Vrefresh=85 >> WinNT.SIFECHO [TapiLocation] >> WinNT.SIFECHO CountryCode=34 >> WinNT.SIFECHO [identification] >> WinNT.SIFECHO JoinWorkgroup=WORKGROUP >> WinNT.SIFECHO [Networking] >> WinNT.SIFECHO InstallDefaultComponents=Yes >> WinNT.SIFECHO [Components] >> WinNT.SIFECHO msmsgs=off >> WinNT.SIFECHO msnexplr=off >> WinNT.SIFECHO freecell=off >> WinNT.SIFECHO hearts=off >> WinNT.SIFECHO zonegames=off >> WinNT.SIFECHO Pinball = Off >> WinNT.SIFECHO [shell] >> WinNT.SIFECHO CustomDefaultThemeFile="%WinDir%\Resources\Themes\NightShades.Theme" >> WinNT.SIFECHO [branding] >> WinNT.SIFECHO BrandIEUsingUnattended=Yes >> WinNT.SIFECHO >> WinNT.SIFECHO Home_Page=http://www.google.com >> WinNT.SIF:FAVORITESECHO.ECHO A web list is going to be created for the Favourites folderECHO Default list=dECHO Customized list=cECHO No list=nSET /P fav=Choose: IF %fav%==d GOTO :DEFAULTIF %fav%==c GOTO :CUSTOMIZEIF %fav%==n GOTO :END1GOTO :FAVORITES:CUSTOMIZEECHO [FavoritesEx] >> WinNT.SIFECHO WHen you are done with your webs type * on WebNameSET i=1:WEBECHO.SET /P webname=WebName: IF %webname%==* GOTO :FINSET /P web=Address: IF %webname%==* GOTO :FINECHO Title%i%=%webname% >> WinNT.SIFECHO URL%i%=http://%web% >> WinNT.SIFSET /A i=%i%+1GOTO :WEB:DEFAULTECHO [FavoritesEx] >> WinNT.SIFECHO Title1=Km77 >> WinNT.SIFECHO URL1=http://www.km77.com/ >> WinNT.SIFECHO Title2=FriendsFactory >> WinNT.SIFECHO URL2=http://www.friendsfactory.com/index.php >> WinNT.SIFECHO Title3="Toms's Hardware" >> WinNT.SIFECHO URL3=http://www.tomshardware.com >> WinNT.SIFECHO Title4=Baluma >> WinNT.SIFECHO URL4=http://www.baluma.com >> WinNT.SIFECHO Title5=Xeron >> WinNT.SIFECHO URL5=http://www.xeron.org >> WinNT.SIFECHO Title6=Yonkis >> WinNT.SIFECHO URL6=http://www.yonkis.com >> WinNT.SIFECHO Title7=CDDB >> WinNT.SIFECHO URL7=http://www.gracenote.com >> WinNT.SIFECHO Title8=CanalXviD >> WinNT.SIFECHO URL8=http://www.canalxvid.com >> WinNT.SIFECHO Title9=Doom9 >> WinNT.SIFECHO URL9=http://www.Doom9.org >> WinNT.SIFECHO Title10="Web de Enigmax" >> WinNT.SIFECHO URL10=http://enigmax.en.eresmas.com/ >> WinNT.SIFECHO Title11="Gamedonkey" >> WinNT.SIFECHO URL11=http://www.gamedonkey.net/php/ >> WinNT.SIF:END1move WinNT.SIF .\Files\CD\BOOT\ECHO.ECHO Stage I succeedpause:START02Set Choice=a:START2CLSECHO Stage II: Users.cmd creationECHO îîîîîîîîîîîîîîîîîîîîîîîîîîîîîîIF '%Choice%' NEQ 'a' GOTO SKIPECHO.ECHO First user will be added to Administrators group:SKIPECHO.Set /p user=User Name: Set /p pass=Password for %user%: IF '%Choice%'=='a' GOTO First:GroupECHO.ECHO Choose the usergroup you want to add the account %user% to:Echo A. AdministratorsEcho B. Guestsset /p group=Seleccion (A/:): if /i '%group%'=='A' goto adduseradminif /i '%group%'=='B' goto adduserGOTO Group:ADDUSERADMINECHO.Set group=AdministradoresSET /P Choice=Are you sure you want to add the user %user% with the pass %pass% to the %group% Group (y/n): IF /I '%Choice%'=='y' GOTO adduser1IF /I '%Choice%'=='n' GOTO START2GOTO ADDUSERADMIN:ADDUSERECHO.Set group=InvitadosSET /P Choice=Are you sure you want to add the user %user% with the pass %pass% to the %group% Group (y/n): IF /I '%Choice%'=='y' GOTO adduser1IF /I '%Choice%'=='n' GOTO START2GOTO ADDUSER:FirstECHO.SET /P Choice=Are you sure you want to add the user %user% with the pass %pass% to the Administrator Group (y/n): IF /I '%Choice%'=='y' GOTO addfirstuser1IF /I '%Choice%'=='n' GOTO START02GOTO :First:Addfirstuser1ECHO Netuser Administrator /name:%user% >> Users.cmdGOTO MORE:ADDUSER1ECHO net user "%user%" "%pass%" /add >> Users.cmdECHO net localgroup "%group%" "%user%" /add >> Users.cmdECHO %user% has been added succesfullyECHO.ECHO.GOTO MORE:MOREECHO.SET /P Choice=More users? (y/n): IF /I '%Choice%'=='y' GOTO START2IF /I '%Choice%'=='n' GOTO END2GOTO MORE:END2move Users.cmd .\Files\CD\$OEM$\$1\PostInstall\CLSECHO.ECHO Stage III: WXPUltraOEM.iso creation and burningECHO îîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîECHO.ECHO Now a image for the CD is going to be createdpauseECHO Please waitREM cdimage.exe -lWXPCustom -t08/23/2001,09:00:00 -b.\Files\CD\xpboot.bin -h -n -m -o -d .\Files\CD C:\Image.iso:BURN0ECHO.SET /P burn=Do you want to burn the image (y/n): IF %burn%==n GOTO :ENDIF %burn%==y GOTO :BURN1GOTO :BURN0:BURN1ECHO.SET /P CD=Type the CDrecorder driveletter (D E F...): ECHO If you are using a CDRW, May I erase it?SET /P erase=If you are using a normal CD type n (y/n): IF %erase%==y GOTO :FORMATIF %erase%==n GOTO :BURNGOTO :BURN1:FORMATREM cdburn.exe %CD%: -erase:BURNREM cdburn.exe %CD%: C:\Image.ISO -speed max -sao:BURN1SET /P DELimg=Do you want to delete the image file? (y/n): IF %dELimg%==y GOTO :DIMGIF %DELimg%==n GOTO :DELGOTO :BURN1:DIMGDEL C:\Image.iso:FINCLSECHO.ECHO Windows XP Personal Edition has finished customizing the filesECHO Please wait while temporal files are being deletedECHO.ECHO.ECHO.ECHO Thanks for using software MontySoftRD /s /Q C:\FilespauseDEL Creador.cmdAny upgrades;) comments, productive critizism are wellcome. It is not a perfect script but im learning batch files with your codes and some little guides. 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