Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

188 lines
5.2 KiB

  1. @echo off
  2. rem %1 TargetDrive
  3. rem %2 TargetDir
  4. rem %3 InstallationPath
  5. rem %4 TSMode RA, AS, NOTS
  6. rem %5 PrivatesPath
  7. setlocal
  8. set _UnAttendFile=c:\temp\un.txt
  9. if not exist c:\temp\. md c:\temp
  10. if exist %_UnAttendFile% goto UnTxtExists
  11. if %1. == . goto GetVars
  12. if %2. == . goto Usage
  13. if %3. == . goto Usage
  14. if %4. == . goto Usage
  15. if %5. == . goto Usage
  16. if %6. == . goto Usage
  17. if %7. NEQ . goto Usage
  18. goto SetVars
  19. :GetVars
  20. set /P _TargetDrive=Target Drive? [d]:
  21. if %_TargetDrive%. == . set _TargetDrive=d
  22. set /P _TargetPath=Target Path? [Winnt]:
  23. if %_TargetPath%. == . set _TargetPath=winnt
  24. set /P _InstallationPath=Installation Path ? [\\mgmtx86fre\latest\srv\i386]:
  25. if %_InstallationPath%. == . set _InstallationPath=\\mgmtx86fre\latest\srv\i386
  26. set /P _TSMode=TS Mode? [RA]:
  27. if %_TSMode%. == . set _TSMode=RA
  28. set /P _PrivatesPath=Private Path? [c:\privates]:
  29. if %_PrivatesPath%. == . set _PrivatesPath=c:\privates
  30. set /P _CompName=Computer Name[%COMPUTERNAME%]:
  31. if %_CompName%. == . set _CompName=%COMPUTERNAME%
  32. goto VarsDone
  33. :SetVars:
  34. set _TargetDrive=%1
  35. set _TargetPath=%2
  36. set _InstallationPath=%3
  37. set _TSMode=%4
  38. set _PrivatesPath=%5
  39. set _CompName=%6
  40. :VarsDone
  41. if not exist %_TargetDrive%:\. goto WrongDrivePath1
  42. if exist %_TargetDrive%:\%_TargetPath%\. goto WrongDrivePath2
  43. if not exist %_InstallationPath%\winnt32.exe goto WrongInstallationPath
  44. if %_TSMode% == RA goto GoodTSMode
  45. if %_TSMode% == AS goto GoodTSMode
  46. if %_TSMode% == NOTS goto GoodTSMode
  47. goto BadTSMode
  48. :GoodTSMode
  49. :ConfirmInput
  50. cls
  51. echo+
  52. echo+
  53. echo * New Installation with be done with following parameters *
  54. echo * -------------------------------------------------------
  55. echo * ComputerName = %_CompName%
  56. echo * TS Mode = %_TSMode%
  57. echo * Target = %_TargetDrive%:\%_TargetPath%
  58. echo * Privates = %_PrivatesPath%
  59. echo * ------------------------------------------------------- *
  60. \\makarp-dev\bin\idw\ync /c YN If you accept this parameters hit Y else N
  61. if %errorlevel% == 1 goto Done
  62. :CreateUnattend
  63. echo ; Copyright (c) 1998 - 1999 Microsoft Corporation >> %_UnAttendFile%
  64. echo+ >> %_UnAttendFile%
  65. echo ;* New Installation with be done with following parameters * >> %_UnAttendFile%
  66. echo ;* ------------------------------------------------------- >> %_UnAttendFile%
  67. echo ;* ComputerName = %_CompName% >> %_UnAttendFile%
  68. echo ;* TS Mode = %_TSMode% >> %_UnAttendFile%
  69. echo ;* Target = %_TargetDrive%:\%_TargetPath% >> %_UnAttendFile%
  70. echo ;* Privates = %_PrivatesPath% >> %_UnAttendFile%
  71. echo ;* ------------------------------------------------------- * >> %_UnAttendFile%
  72. echo ;*%_InstallationPath%\winnt32.exe /unattend:%_UnAttendFile% /m:%_PrivatesPath% /tempdrive:%_TargetDrive% >> %_UnAttendFile%
  73. echo+ >> %_UnAttendFile%
  74. echo+ >> %_UnAttendFile%
  75. echo [Unattended] >> %_UnAttendFile%
  76. echo OemPreinstall=No >> %_UnAttendFile%
  77. echo DriverSigningPolicy=Ignore >> %_UnAttendFile%
  78. echo OemSkipEula=Yes >> %_UnAttendFile%
  79. echo FileSystem=LeaveAlone >> %_UnAttendFile%
  80. echo ConfirmHardware=No >> %_UnAttendFile%
  81. echo NtUpgrade=No >> %_UnAttendFile%
  82. echo TargetPath=%_TargetPath% >> %_UnAttendFile%
  83. echo+ >> %_UnAttendFile%
  84. echo [GuiUnattended] >> %_UnAttendFile%
  85. echo AdminPassword=* >> %_UnAttendFile%
  86. echo AutoLogon=Yes >> %_UnAttendFile%
  87. echo TimeZone=004 >> %_UnAttendFile%
  88. echo+ >> %_UnAttendFile%
  89. echo [Display] >> %_UnAttendFile%
  90. echo BitsPerPel=8 >> %_UnAttendFile%
  91. echo Xresolution=1024 >> %_UnAttendFile%
  92. echo Yresolution=768 >> %_UnAttendFile%
  93. echo Vrefresh=60 >> %_UnAttendFile%
  94. echo+ >> %_UnAttendFile%
  95. echo [UserData] >> %_UnAttendFile%
  96. echo FullName="Makarand Patwardhan" >> %_UnAttendFile%
  97. echo OrgName="Microsoft Corporation" >> %_UnAttendFile%
  98. echo ComputerName=%_CompName% >> %_UnAttendFile%
  99. echo+ >> %_UnAttendFile%
  100. echo [LicenseFilePrintData] >> %_UnAttendFile%
  101. echo AutoMode=PERSEAT >> %_UnAttendFile%
  102. echo+ >> %_UnAttendFile%
  103. echo [Networking] >> %_UnAttendFile%
  104. echo InstallDefaultComponents=Yes >> %_UnAttendFile%
  105. echo+ >> %_UnAttendFile%
  106. echo [Identification] >> %_UnAttendFile%
  107. echo JoinWorkgroup=WKGRP >> %_UnAttendFile%
  108. echo+ >> %_UnAttendFile%
  109. echo [Components] >> %_UnAttendFile%
  110. if %_TSMode% == NOTS (
  111. echo TSEnable=OFF >> %_UnAttendFile%
  112. ) else (
  113. echo TSEnable=ON >> %_UnAttendFile%
  114. )
  115. echo+ >> %_UnAttendFile%
  116. echo+ >> %_UnAttendFile%
  117. echo [TerminalServices] >> %_UnAttendFile%
  118. if %_TSMode% == RA echo ApplicationServer=0 >> %_UnAttendFile%
  119. if %_TSMode% == AS echo ApplicationServer=1 >> %_UnAttendFile%
  120. echo PermissionsSetting=0 >> %_UnAttendFile%
  121. echo+ >> %_UnAttendFile%
  122. rem now run our unattend batchfile
  123. %_InstallationPath%\winnt32.exe /unattend:%_UnAttendFile% /m:%_PrivatesPath% /tempdrive:%_TargetDrive%
  124. goto Done
  125. :UnTxtExists
  126. echo c:\temp\un.txt already exists. Please delete this file before proceeding.
  127. goto Done
  128. :WrongDrivePath1
  129. echo Specified, TargetDrive, is wrong since %_TargetDrive%:\. does not exist.
  130. goto Done
  131. :WrongDrivePath2
  132. echo Specified, TargetDrive, is wrong since %_TargetDrive%:\%_TargetPath%\. exists.
  133. goto Done
  134. :WrongInstallationPath
  135. echo Specified Installation path is wrong since %_InstallationPath%\winnt32.exe does not exist.
  136. goto Done
  137. :Usage
  138. echo Usage %0 [TargetDrive] [TargetDir] [InstallationPath] [TSMode] [PrivatesPath] [CompName]
  139. :Done