-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuildpe.cmd
643 lines (541 loc) · 20.8 KB
/
buildpe.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
@echo off
cls
REM BUILDPE.CMD
REM
REM Function: automates creating the USB stick or CD
REM used to deploy Steadier State to a system
REM End product: an ISO folder and optionally puts
REM it on a USB stick.
REM
REM Inputs and Assumptions
REM Assumes: WAIK installed in default location
REM Can create and delete a folder %temp%\SDRSTATE
REM Inputs: Which architecture to use, 32 or 64 bit
REM Where to write the ISO for a CD (or not to)
REM Drive letter of the USB stick to create
REM (or not to create a USB stick)
REM
REM WAIK LOCATION
REM Needs the WAIK installed in its default location
REM If that's an issue, change the next line to point
REM to the top level folder in wherever you installed
REM the WAIK.
REM
set mediaVolName=STDYR-STATE
set WAIKBase=C:\Program Files\Windows AIK\Tools
if not exist "C:\Program Files\Windows AIK\Tools" ((Echo For this to work, you MUST have the Windows Automated Installation Kit downloaded and installed in its default location, or modify the "set WAIKBASE=" line in the command file with the WAIK's alternate location; exiting.)&(goto :badend))
set makeiso=true
set madeiso=
set makeusb=true
set usbdriveletter=none
set logdir=C:\windows\logs\buildpelogs
REM
REM Check that we're running as an admin
REM
del temp.txt 2> nul
whoami /groups |find /c "High Mandatory">temp.txt
set total=
set /p total= <temp.txt
del temp.txt 2>nul
if %total%==1 goto :youreanadmin
echo.
echo I'm sorry, but you must be running from an elevated
echo command prompt to run this command file. Start a new
echo command prompt by right-clicking the Command Prompt icon, and
echo then choose "Run as administrator" and click "yes" if you see
echo a UAC prompt.
goto :done
:youreanadmin
REM
REM Set up and test logging
REM
rd %logdir% /q /s 2>nul
md %logdir%\test
if exist %logdir%\test ((rd %logdir%\test /q /s) & (goto :canlog))
rem
rem
echo.
echo I can't seem to delete the old logs; continuing anyway.
echo.
:canlog
echo.
echo ___________________________________________________________
echo B U I L D U S B / I S O T O O L
echo ___________________________________________________________
echo.
echo This command file (buildpe.cmd) creates the tool you'll
echo need to get started using Steadier State, the free "Windows
echo Rollback," SteadyState-like tool for un-doing all changes
echo to a Windows system in under three minutes. This creates a
echo bootable USB stick or CD that you can then use to prepare a
echo computer for Steadier State.
echo.
echo You've got some options about building that tool, however, so
echo this command file will have to ask a few questions before we
echo get started.
echo.
echo To stop this program, you can type the word "end" as the answer
echo to any question. Please type all responses in LOWERCASE!
:usbquestions
echo.
echo =========================================================
echo Question 1: Where's the USB stick (if any)?
echo.
echo Would you like me to set up the Steadier State install tool on a bootable
echo USB stick (or any other UFD device, for that matter)?
echo.
echo REMINDER: I'M GOING TO WIPE THAT DEVICE CLEAN!!!
echo.
echo Type "y" (without the quotes) to set up a USB stick. Enter anything
echo else to NOT create a USB stick, or "end" to end this program.
set /p resp=What's your answer?
echo.
if a%resp%==aend ((echo.) & (echo Exiting as requested.) & (goto :done))
if not a%resp%==ay goto :nousbstick
echo.
echo Okay, what is that USB stick's drive letter?
echo Enter its drive letter -- just the letter, don't
set /p usbdriveletter=add a colon (":") after it -- and press Enter.
if a%usbdriveletter%==aend ((echo.) & (echo Exiting as requested.) & (goto :done))
echo.
if not exist %usbdriveletter%:\ ((echo.)&(echo ---- ERROR ----)&(echo.)&(echo.)&(echo There doesn't seem to be a USB stick at %usbdriveletter%:. Let's try again.)&(echo.)&(goto :usbquestions))
REM
REM If not, there's a USB stick there.
rem I need this to be uppercase so now I'll have to uppercase it.
rem
if %usbdriveletter%==C set usbdriveletter=C
if %usbdriveletter%==d set usbdriveletter=D
if %usbdriveletter%==e set usbdriveletter=E
if %usbdriveletter%==f set usbdriveletter=F
if %usbdriveletter%==g set usbdriveletter=G
if %usbdriveletter%==h set usbdriveletter=H
if %usbdriveletter%==i set usbdriveletter=I
if %usbdriveletter%==j set usbdriveletter=J
if %usbdriveletter%==k set usbdriveletter=K
if %usbdriveletter%==l set usbdriveletter=L
if %usbdriveletter%==m set usbdriveletter=M
if %usbdriveletter%==n set usbdriveletter=N
if %usbdriveletter%==o set usbdriveletter=O
if %usbdriveletter%==p set usbdriveletter=P
if %usbdriveletter%==q set usbdriveletter=Q
if %usbdriveletter%==r set usbdriveletter=R
if %usbdriveletter%==s set usbdriveletter=S
if %usbdriveletter%==t set usbdriveletter=T
if %usbdriveletter%==u set usbdriveletter=U
if %usbdriveletter%==v set usbdriveletter=V
if %usbdriveletter%==w set usbdriveletter=W
if %usbdriveletter%==x set usbdriveletter=X
if %usbdriveletter%==y set usbdriveletter=Y
if %usbdriveletter%==z set usbdriveletter=Z
REM
echo Found a USB device at %usbdriveletter%:.
rem
goto :Isoquestions
:nousbstick
echo.
echo Okay, no need to create a bootable USB stick.
echo.
set makeusb=false
:ISOquestions
echo.
echo.
echo =========================================================
echo Question 2: ISO File or no?
echo.
echo Would you like me to create an ISO file of a bootable CD image
echo (equipped with the Steadier State install files) that you can burn to a
echo CD or use in a virtual machine environment? This will be useful
echo in situations where you don't have a USB stick or perhaps one
echo might not work. To create the ISO, please respond "y" and Enter.
set /p resp=Type y to make the ISO, end to exit, anything else to skip making the ISO?
if a%resp%==aend ((echo.) & (echo Exiting as requested.) & (goto :done))
if not a%resp%==ay goto :noiso
set makeiso=true
echo.
echo Okay, I will create an ISO file in your Documents folder.
echo.
goto :archquestion
:noiso
echo.
echo Okay, I won't create an ISO file.
set makeiso=false
:archquestion
REM
REM test to see if neither output desired
REM
if not %makeiso%%makeusb%==falsefalse goto :askarch
echo.
echo You've selected that you want neither a USB stick nor an ISO
echo file, so there'd be no point in continuing. Exiting...
echo.
goto :done
:askarch
echo.
echo.
echo =========================================================
echo Question 3: 32 bit or 64 bit?
echo.
echo Next, will you be putting this on a 32-bit or 64-bit
echo system? Please enter either "32" or "64" and press Enter.
set /p resp=Your response?
if a%resp%==aend ((echo.) & (echo Exiting as requested.) & (goto :done))
set arch=nothing
set len=48
if a%resp% == a64 ((set arch=amd64)&(set len=64)& (goto :sdrstatefiles))
if a%resp% == a32 ((set arch=x86)&(set len=32) &(goto :sdrstatefiles))
echo.
echo -------- ERROR -----------
echo.
echo Sorry, that didn't match either "32" or "64."
echo.
goto :askarch
:sdrstatefiles
echo.
echo =========================================================
echo Question 4: Where are the Steadier State files?
echo.
echo Finally, where is the folder with the Steadier State command files,
echo the folder containing merge.cmd, startnet.cmd and PrepSSdisk.cmd?
echo Please enter the folder name here and press Enter; again, to stop
echo this program just type "end" and press Enter:
echo.
set /p ssFiles=Your response (folder name for Steadier State files)?
if a%ssFiles%==aend ((echo Exiting at your request.)&(echo.)& (goto :done))
echo.
echo Checking for the files in folder "%ssFiles%"...
if not exist %ssFiles%\PrepSSdisk.cmd ((echo PrepSSdisk.cmd not found in %ssFiles%.)&(goto :sdrstatefiles))
if not exist %ssFiles%\merge.cmd ((echo merge.cmd not found in %ssFiles%.)&(goto :sdrstatefiles))
if not exist %ssFiles%\newBcD.cmd ((echo newBcD.cmd not found in %ssFiles%.)&(goto :sdrstatefiles))
if not exist %ssFiles%\startnet.cmd ((echo startnet.cmd not found in %ssFiles%.)&(goto :sdrstatefiles))
if not exist %ssFiles%\cvt2vhd.cmd ((echo cvt2vhd.cmd not found in %ssFiles%.)&(goto :sdrstatefiles))
:confirm
echo.
echo Now I'm ready to prepare your USB stick and/or ISO.
echo Confirming, you chose:
echo.
echo Architecture=%len% bit.
echo Make a USB stick=%makeusb%
if %makeusb%==true echo Drive for USB stick=%usbdriveletter%:
echo Make an ISO file=%makeiso%
echo WAIK installed: verified
REM
REM Set temp name of WinPE folder
if /I NOT exist C:\Temp mkdir C:\Temp
set fname=C:\Temp\BuildPE
echo WinPE workspace folder=%fname%
echo (Folder will be automatically deleted once we're finished.)
echo Media volume name=%mediaVolName%
set isofilespec=%userprofile%\documents\ssInstaller%len%.iso
if %makeiso%==true echo File name and location of ISO file=%isofilespec%
echo Location of Steadier State command files=%ssFiles%
set nousbdrive=true
if %makeusb%==true set nousbdrive=false
echo Architecture=%len% bit.>%logdir%\startlog.txt
echo Make a USB stick=%makeusb% >>%logdir%\startlog.txt
if %makeusb%==true echo Drive for USB stick=%usbdriveletter%: >>%logdir%\startlog.txt
echo Make an ISO file=%makeiso% >>%logdir%\startlog.txt
echo WAIK installed: verified >>%logdir%\startlog.txt
echo WinPE workspace folder=%fname% >>%logdir%\startlog.txt
echo USB/CD volume name=%mediaVolName% >>%logdir%\startlog.txt
if %makeiso%==true echo File name and location of ISO file=%isofilespec% >>%logdir%\startlog.txt
echo Location of Steadier State command files=%ssFiles% >>%logdir%\startlog.txt
echo.
echo Please press "y" and Enter to confirm that you want to
set /p resp=do this, or anything else and Enter to stop.
echo.
if not a%resp%==ay goto :done
if a%resp%==aend ((echo.) & (echo Exiting as requested.) & (goto :done))
echo.
echo Buildpe started. This may take about five to ten minutes in total.
echo.
echo If this fails, look in %logdir% for detailed output and logs
echo of the each stage of the process.
echo.
echo First, clean up any mess from previous BUILDPE runs.
echo.
REM
REM Let's get to work
REM
REM First, delete any existing WinPE folders or ISO files
REM
rd %fname% /s /q 2>NUL
del %isofilespec% 2>NUL
REM create DL, drive letter, add colon
set dl=%usbdriveletter:~0,1%:
echo Then, create a WinPE workspace, using the WAIK tools.
echo.
REM To work! Create WinPE workspace
REM
REM add WAIK path stuff
pushd
echo Setting WAIK environment variables >>%logdir%\startlog.txt
call "%WAIKBase%\PETools\pesetenv.cmd" >%logdir%\01setpcmdprompt.txt
popd
echo Creating WinPE workspace >>%logdir%\startlog.txt
call copype %arch% %fname% >%logdir%\02createwinpeworkspace.txt
popd
echo Next, mount that WinPE so we can install some Steadier State files
echo into that WinPE. This can take a minute or two.
echo.
REM
REM Mount the folder
echo Mounting Winpe.wim >>%logdir%\startlog.txt
imagex /mountrw %fname%\winpe.wim 1 %fname%\mount >%logdir%\03imagexmount.txt
set imagexrc=%errorlevel%
If %imagexrc%==0 goto :imagexok
echo.
echo ********** ERROR: Imagex mount attempt failed ******************
echo
echo The answer may simply be an incompletely dismounted previous run
echo and in that case a simple reboot may clear things up. Here's the
echo output from the attempted mount:
echo ============= OUTPUT STARTS=====================================
type %logdir%\imagexmount.txt
echo ============== OUTPUT ENDS ======================================
echo.
echo Exiting.
goto :badend
:imagexok
echo.
echo WinPE space created with copype and WinPE's boot.wim mounted with ImageX.
echo.
echo Winpe.wim mounted, imagex rc=%errorlevel% >>%logdir%\startlog.txt
echo Creating and copying scripts to the USB stick and/or ISO image...
set peSysRoot=%fname%\mount\windows\system32
set sdrState=%fname%\mount\SDRState
set ssOther=%sdrState%\Other
md %sdrState% >nul
md %ssOther% >nul
copy %ssFiles%\*.cmd %sdrState% /y >>%logdir%\04sdrstatecopy.txt
copy %ssFiles%\winpe1.bmp %peSysRoot%\winpe.bmp /y >>%logdir%\04sdrstatecopy.txt
copy %ssFiles%\startnet.cmd %peSysRoot%\startnet.cmd /y >>%logdir%\04sdrstatecopy.txt
copy "%WAIKBase%\%arch%\bootmgr %ssOther% /y >>%logdir%\04sdrstatecopy.txt
copy "%WAIKBase%\PETools\%arch%\imagex.exe" %peSysRoot% /y >>%logdir%\04sdrstatecopy.txt
copy "%WAIKBase%\PETools\%arch%\BootSect.exe" %peSysRoot% /y >>%logdir%\04sdrstatecopy.txt
echo WinPE-SS-ID>%fname%\mount\MediaID.txt
REM There are a few things we'll need while not booted to WinPE-SS,
REM but since the -d option to oscdimg renders the ISO unbootable the
REM PrepSSdisk.cmd will have to copy this Other folder to the vhdDrive
copy %ssFiles%\*.docx %ssOther% /y >>%logdir%\04sdrstatecopy.txt
copy %ssFiles%\*.pptx %ssOther% /y >>%logdir%\04sdrstatecopy.txt
copy %ssFiles%\newBcD.cmd %ssOther% /y >>%logdir%\04sdrstatecopy.txt
xcopy %ssFiles%\sysprep %ssOther%\sysprep /Y /I /S >>%logdir%\04sdrstatecopy.txt
xcopy %ssFiles%\grub %ssOther%\grub /Y /I /S >>%logdir%\04sdrstatecopy.txt
REM
REM Unmount, we're done
REM
imagex /unmount %fname%\mount /commit >%logdir%\05imagexunmount.txt
set imagexrc=%errorlevel%
If %imagexrc%==0 goto :imagexok2
echo.
echo ********** ERROR: Imagex unmount attempt failed ******************
echo
echo The answer may simply be an incompletely dismounted previous run
echo and in that case a simple reboot may clear things up. Here's the
echo output from the attempted mount:
echo ============= OUTPUT STARTS=====================================
type %logdir%\imagexunmount.txt
echo ============== OUTPUT ENDS ======================================
echo.
echo Exiting.
goto :badend
:imagexok2
echo Successfully copied files and unmounted boot.wim.
echo Unmounted winpe.wim, imagex RC=%errorlevel% >>%logdir%\startlog.txt
echo.
REM
REM Install boot.wim
REM
move %fname%\winpe.wim %fname%\iso\sources\boot.wim >>%logdir%\startlog.txt
REM
REM The ISO folder is now ready
REM
echo Moved winpe.wim to ISO folder, folder is ready >>%logdir%\startlog.txt
REM Time to make the USB drive
REM
if %makeusb%==false goto :donecreatingusb
echo Starting to create USB stick. >>%logdir%\startlog.txt
REM
REM WIPE AND REBUILD USB STICK
REM Sets up DISKPART to be able to create our USB stick.
REM In the process, we'll have to run DISKPART three times
REM
REM STEP ONE: RETRIEVE VOLUME NUMBER
REM Given a drive letter in %usbdriveletter%, find its volume number
REM And then given a volume name in %mediaVolName%, set the volume up
set founddisk=false
set foundvolume=false
set volwewant=
set disknum=
REM Create script to get volume list in diskpart
echo lis vol >%logdir%\diskpartscript1.txt
echo exit >>%logdir%\diskpartscript1.txt
echo Running Diskpart to retrieve volume numbers, this may take a minute...
diskpart /s %logdir%\diskpartscript1.txt > %logdir%\dpout1.txt
set dr1=%errorlevel%
if %dr1%==0 ((echo Diskpart phase 1 ended successfully, analyzing output.)&(goto :dphase1))
echo Diskpart phase 1 failed, return code %dr1%.
echo It's not really safe to continue -- I'd hate to blow away the wrong
echo disk! -- so I'm stopping here and here's the Diskpart output -- there
echo should be a clue in there.
echo DISKPART OUTPUT:
type %logdir%\dpout1.txt
echo ================================
goto :donecreatingusb
:dphase1
REM
REM Analyzing first diskpart results
REM
for /f "tokens=1-4" %%i in (%logdir%\dpout1.txt) do (if %%i%%k==Volume%usbdriveletter% ((set volwewant=%%j) & (set foundvolume=true)))
if %foundvolume%==false ((Echo unable to find drive %usbdriveletter%: in this Diskpart output:)&(type diskpartout.txt)&(echo Unable to set USB stick to "active" automatically.)&(echo Consult the documentation for instructions on doing it manually.)&(goto :badend))
if %foundvolume%==true (echo Success; drive %usbdriveletter% is on volume number %volwewant%.)
REM
REM Now build script #2: given a volume number, what's the number of the disk that it is on?
REM
echo sel vol %volwewant% > %logdir%\diskpartscript2.txt
echo det vol >> %logdir%\diskpartscript2.txt
echo exit >> %logdir%\diskpartscript2.txt
REM
REM Run the script
REM
diskpart /s %logdir%\diskpartscript2.txt > %logdir%\dpout2.txt
set t=%errorlevel%
if a%t%==a0 ((echo Diskpart phase 2 completed successfully. Now analyzing output.)&(goto :findusbdisk))
echo Diskpart failed with return code %t%. Unable to retrieve disk number for USB stick, USB prep failed.
goto :donecreatingusb
:findusbdisk
REM
REM Second results
REM
for /f "tokens=1-3" %%i in (%logdir%\dpout2.txt) do ( if *Disk==%%i%%j ( (set disknum=%%k) & (set founddisk=true) ) )
if %founddisk%==false ((Echo ERROR: failed to identify the volume's disk number, can't build the USB stick. Consult the documentation or build an ISO and use a CD) & (echo.) & (goto :badend))
echo Success; drive %usbdriveletter%: is on disk number %disknum%.
echo Formatting the USB stick now.
REM
REM Write the final diskpart script now
REM
echo select disk %disknum% > %logdir%\diskpartscript3.txt
echo clean >> %logdir%\diskpartscript3.txt
echo create partition primary >> %logdir%\diskpartscript3.txt
echo active >> %logdir%\diskpartscript3.txt
echo format fs=fat32 quick label=%mediaVolName% >> %logdir%\diskpartscript3.txt
echo assign letter=%usbdriveletter% >> %logdir%\diskpartscript3.txt
echo exit >> %logdir%\diskpartscript3.txt
REM
REM Final Diskpart run
REM
diskpart /s %logdir%\diskpartscript3.txt > %logdir%\dpout3.txt
set t=%errorlevel%
if a%t%==a0 ((echo Diskpart phase 3 completed successfully, USB stick formatted.)&(goto :copytousb))
echo Diskpart failed with return code %t%. USB stick build failed.
goto :donecreatingusb
:copytousb
echo.
echo Next, I'll copy the WinPE source to the USB stick and/or
echo ISO file, using Robocopy. It's a big file, so this may take a
echo minute.
echo.
robocopy %fname%\ISO\ %dl% /e > %logdir%\05robocopyout.txt
set t=%errorlevel%
if a%t%==a1 ((echo Robocopy completed successfully.)&(goto :donecreatingusb))
echo Robocopy failed with return code %t. USB stick NOT successfully created.
:usbok
echo.
echo USB drive at %usbdriveletter%: now ready.
echo.
echo USB stick completed. >>%logdir%\startlog.txt
:skipsetactive
rem
Echo USB stick created.
:donecreatingusb
if %makeiso%==false goto :donewithiso
REM this should work, as we should still be in the
REM WinPE workspace folder
echo Creating ISO with oscdimg... >>%logdir%\startlog.txt
oscdimg -h -n -betfsboot.com ISO %isofilespec% >%logdir%\06oscdimgoutput.txt
set oscdrc=%errorlevel%
if %oscdrc%==0 ((echo OSCDIMG succeeded, return code 0.) &(goto :oscdok))
echo.
echo Warning: OSCDIMG returned error code %oscdrc%, ISO may not have been
echo written right.
:oscdok
echo OSCDIMG complete with rc=%errorlevel% >>%logdir%\startlog.txt
set madeiso=true
:donewithiso
rem finished without problems.
echo BuildPE finished successfully. Cleaning up... >>%logdir%\startlog.txt
REM change path so we can delete the WinPE workspace
c:
pushd c:\
REM
REM get rid of old WinPE workspace
REM
echo Deleting WinPE workspace. >>%logdir%\startlog.txt
if not a%fname%==a rd %fname% /s /q 2>nul
popd
echo.
echo Done. Now that you have a USB stick and/or an ISO, you can use them
echo either to convert a working Windows system into one that can be
echo protected by Steadier State's "Roll Back Windows" feature, or you can
echo use them to prepare a system to get a Steadier State-equipped image
echo deployed to it.
echo.
echo In both cases, start by booting the system with the USB stick or CD.
echo Then, to convert a working Windows system to an SS-ready image, run
echo "cvt2vhd." Alternatively, to get a system ready for deployment, run
echo "PrepSSdisk". There are more detailed instructions for using those
echo command files in the documentation, or they also include some built-
echo in documentation.
echo.
if a%madeiso%==atrue echo Your ISO is in %isofilespec%.
echo.
echo Thanks for trying Steadier State, I hope it's useful.
echo -- Mark Minasi [email protected] www.steadierstate.com
echo.
set fname=
set arch=
set ssFiles=
set dl=
set nousbdrive=
set len=
set makeusb=
set makeiso=
set madeiso=
set isofilespec=
set usbdriveletter=
set foundvolume=
set volwewant=
set usbok=
set t=
goto :eof
:badend
Echo.
echo Buildpe failed and terminated for some reason. If you'd like to look
echo further into what might have failed, back up the folder
echo "%logdir% and the files in it and examine them for clues
echo about what went wrong. Cleaning up temporary files...
echo.
imagex /unmount mount > %logdir%\badendimagexunmount.txt
REM change path so we can delete the WinPE workspace
c:
cd\
REM
REM get rid of old WinPE workspace
REM
echo Deleting WinPE workspace. >>%logdir%\startlog.txt
if not a%fname%==a rd %fname% /s /q 2>nul
set fname=
set arch=
set ssFiles=
set dl=
set nousbdrive=
set len=
set makeusb=
set makeiso=
set madeiso=
set isofilespec=
set drvletter=
set foundvolume=
set volwewant=
goto :eof
:done