Jump to content

Batch file to create...


Recommended Posts

Hi pple!

Fistly i must thank hysel for the code he posted a couple days ago, it was my inspiration :rolleyes: I made my own with some more features (not too much): create a bit customized winnt.sif, create the ISO and burn it

So the batch is supposed :D 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 :D

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 CDs

It 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 :D Please check my translation, i hope it wont make the file fails. Here is the code:

CLS

@ ECHO OFF

TITLE Windows XP Personal Edition

COLOR 0F

ECHO.

ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»

ECHO º                                                        º

ECHO º    Welcome to the Windows XP Personal Edition Creator  º

ECHO º                                                        º

ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ

ECHO.

ECHO      Stage I: WinNT.SIF creation

ECHO      Stage II:  Users.cmd creation

ECHO      Stage III: WXPUltraOEM.iso creation and burning

ECHO.

pause

CLS

ECHO.

ECHO                        Stage I: WinNT.SIF creation           

ECHO                          îîîîîîîîîîîîîîîîîîîîîîîîîîîîî

:BACK1

ECHO [Data]>> WinNT.SIF

ECHO  AutoPartition=0 >> WinNT.SIF

ECHO  MsDosInitiated="0" >> WinNT.SIF

ECHO  UnattendedInstall="Yes" >> WinNT.SIF

ECHO [unattended] >> WinNT.SIF

ECHO  Repartition=No >> WinNT.SIF

ECHO  UnattendMode=FullUnattended >> WinNT.SIF

ECHO  OemSkipEula=Yes >> WinNT.SIF

ECHO  OemPreinstall=Yes >> WinNT.SIF

ECHO  TargetPath=\WINDOWS >> WinNT.SIF

ECHO  UnattendSwitch="yes" >> WinNT.SIF

ECHO  WaitForReboot="No" >> WinNT.SIF

ECHO  DriverSigningPolicy=Ignore >> WinNT.SIF

ECHO  KeyboardLayout="Espa¤ol" >> WinNT.SIF

ECHO  DriverSigningPolicy=Ignore  >> WinNT.SIF

ECHO  Hibernation=No >> WinNT.SIF

ECHO  IncludeCatalog=KB826939.cat >> WinNT.SIF

ECHO [GuiUnattended] >> WinNT.SIF

ECHO  AdminPassword=* >> WinNT.SIF

ECHO  EncryptedAdminPassword=NO >> WinNT.SIF

ECHO  OEMSkipRegional=1 >> WinNT.SIF

ECHO  TimeZone=105 >> WinNT.SIF

ECHO  OemSkipWelcome=1 >> WinNT.SIF

ECHO [userData] >> WinNT.SIF

ECHO.

ECHO Type your Windows XP serial number

ECHO.

SET /P serial=Serial:

ECHO  ProductKey=%serial% >> WinNT.SIF

ECHO.

ECHO Type your name, organization and PC Name

SET /P name=Name:

SET /P org=Organization:

SET /P PCName=PC Name:

ECHO  FullName="%name%" >> WinNT.SIF

ECHO  OrgName="%org%" >> WinNT.SIF

ECHO  Computername=%PCName% >> WinNT.SIF

ECHO [Display] >> WinNT.SIF

ECHO  BitsPerPel=32 >> WinNT.SIF

ECHO  Xresolution=1280 >> WinNT.SIF

ECHO  YResolution=960 >> WinNT.SIF

ECHO  Vrefresh=85 >> WinNT.SIF

ECHO [TapiLocation] >> WinNT.SIF

ECHO  CountryCode=34 >> WinNT.SIF

ECHO [identification] >> WinNT.SIF

ECHO  JoinWorkgroup=WORKGROUP >> WinNT.SIF

ECHO [Networking] >> WinNT.SIF

ECHO  InstallDefaultComponents=Yes >> WinNT.SIF

ECHO [Components] >> WinNT.SIF

ECHO  msmsgs=off >> WinNT.SIF

ECHO  msnexplr=off >> WinNT.SIF

ECHO  freecell=off >> WinNT.SIF

ECHO  hearts=off >> WinNT.SIF

ECHO  zonegames=off >> WinNT.SIF

ECHO  Pinball = Off >> WinNT.SIF

ECHO [shell]  >> WinNT.SIF

ECHO  CustomDefaultThemeFile="%WinDir%\Resources\Themes\NightShades.Theme" >> WinNT.SIF

ECHO [branding] >> WinNT.SIF

ECHO BrandIEUsingUnattended=Yes >> WinNT.SIF

ECHO >> WinNT.SIF

ECHO  Home_Page=http://www.google.com >> WinNT.SIF

:FAVORITES

ECHO.

ECHO A web list is going to be created for the Favourites folder

ECHO Default list=d

ECHO Customized list=c

ECHO No list=n

SET /P fav=Choose:

IF %fav%==d GOTO :DEFAULT

IF %fav%==c GOTO :CUSTOMIZE

IF %fav%==n GOTO :END1

GOTO :FAVORITES

:CUSTOMIZE

ECHO [FavoritesEx] >> WinNT.SIF

ECHO WHen you are done with your webs type * on WebName

SET i=1

:WEB

ECHO.

SET /P webname=WebName:

IF %webname%==* GOTO :FIN

SET /P web=Address:

IF %webname%==* GOTO :FIN

ECHO Title%i%=%webname% >> WinNT.SIF

ECHO URL%i%=http://%web% >> WinNT.SIF

SET /A i=%i%+1

GOTO :WEB

:DEFAULT

ECHO [FavoritesEx] >> WinNT.SIF

ECHO  Title1=Km77 >> WinNT.SIF

ECHO  URL1=http://www.km77.com/ >> WinNT.SIF

ECHO  Title2=FriendsFactory >> WinNT.SIF

ECHO  URL2=http://www.friendsfactory.com/index.php >> WinNT.SIF

ECHO  Title3="Toms's Hardware" >> WinNT.SIF

ECHO  URL3=http://www.tomshardware.com >> WinNT.SIF

ECHO  Title4=Baluma >> WinNT.SIF

ECHO  URL4=http://www.baluma.com >> WinNT.SIF

ECHO  Title5=Xeron >> WinNT.SIF

ECHO  URL5=http://www.xeron.org >> WinNT.SIF

ECHO  Title6=Yonkis >> WinNT.SIF

ECHO  URL6=http://www.yonkis.com >> WinNT.SIF

ECHO  Title7=CDDB >> WinNT.SIF

ECHO  URL7=http://www.gracenote.com >> WinNT.SIF

ECHO  Title8=CanalXviD >> WinNT.SIF

ECHO  URL8=http://www.canalxvid.com >> WinNT.SIF

ECHO  Title9=Doom9 >> WinNT.SIF

ECHO  URL9=http://www.Doom9.org >> WinNT.SIF

ECHO  Title10="Web de Enigmax" >> WinNT.SIF

ECHO  URL10=http://enigmax.en.eresmas.com/ >> WinNT.SIF

ECHO  Title11="Gamedonkey" >> WinNT.SIF

ECHO  URL11=http://www.gamedonkey.net/php/ >> WinNT.SIF

:END1

move WinNT.SIF .\Files\CD\BOOT\

ECHO.

ECHO Stage I succeed

pause

:START02

Set Choice=a

:START2

CLS

ECHO                        Stage II: Users.cmd creation

ECHO                          îîîîîîîîîîîîîîîîîîîîîîîîîîîîîî

IF '%Choice%' NEQ 'a' GOTO SKIP

ECHO.

ECHO First user will be added to Administrators group

:SKIP

ECHO.

Set /p user=User Name:

Set /p pass=Password for %user%:

IF '%Choice%'=='a' GOTO First

:Group

ECHO.

ECHO Choose the usergroup you want to add the account %user% to:

Echo A. Administrators

Echo B. Guests

set /p group=Seleccion (A/:):

if /i '%group%'=='A' goto adduseradmin

if /i '%group%'=='B' goto adduser

GOTO Group

:ADDUSERADMIN

ECHO.

Set group=Administradores

SET /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 adduser1

IF /I '%Choice%'=='n' GOTO START2

GOTO ADDUSERADMIN

:ADDUSER

ECHO.

Set group=Invitados

SET /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 adduser1

IF /I '%Choice%'=='n' GOTO START2

GOTO ADDUSER

:First

ECHO.

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 addfirstuser1

IF /I '%Choice%'=='n' GOTO START02

GOTO :First

:Addfirstuser1

ECHO Netuser Administrator /name:%user% >> Users.cmd

GOTO MORE

:ADDUSER1

ECHO net user "%user%" "%pass%" /add >> Users.cmd

ECHO net localgroup "%group%" "%user%" /add >> Users.cmd

ECHO %user% has been added succesfully

ECHO.

ECHO.

GOTO MORE

:MORE

ECHO.

SET /P Choice=More users? (y/n):

IF /I '%Choice%'=='y' GOTO START2

IF /I '%Choice%'=='n' GOTO END2

GOTO MORE

:END2

move Users.cmd .\Files\CD\$OEM$\$1\PostInstall\

CLS

ECHO.

ECHO              Stage III: WXPUltraOEM.iso creation and burning

ECHO                îîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîî

ECHO.

ECHO Now a image for the CD is going to be created

pause

ECHO Please wait

REM cdimage.exe -lWXPCustom -t08/23/2001,09:00:00 -b.\Files\CD\xpboot.bin -h -n -m -o -d .\Files\CD C:\Image.iso

:BURN0

ECHO.

SET /P burn=Do you want to burn the image (y/n):

IF %burn%==n GOTO :END

IF %burn%==y GOTO :BURN1

GOTO :BURN0

:BURN1

ECHO.

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 :FORMAT

IF %erase%==n GOTO :BURN

GOTO :BURN1

:FORMAT

REM cdburn.exe %CD%: -erase

:BURN

REM cdburn.exe %CD%: C:\Image.ISO -speed max -sao

:BURN1

SET /P DELimg=Do you want to delete the image file? (y/n):

IF %dELimg%==y GOTO :DIMG

IF %DELimg%==n GOTO :DEL

GOTO :BURN1

:DIMG

DEL C:\Image.iso

:FIN

CLS

ECHO.

ECHO Windows XP Personal Edition has finished customizing the files

ECHO Please wait while temporal files are being deleted

ECHO.

ECHO.

ECHO.

ECHO                    Thanks for using software MontySoft

RD /s /Q C:\Files

pause

DEL Creador.cmd

Any 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


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...