Example of using initscript.cmd with TBWinRE?

User discussion and information resource forum for Image products.

Example of using initscript.cmd with TBWinRE?

Postby PsychBiller » Tue Jun 28, 2016 8:09 pm

I'd like to use initscript.cmd to run manage-bde to unlock my BitLocker-encrypted partition automatically before launching IFW when booting from a TBWinRE USB drive. What type of scripting language does this use? TBScript? All I want is an example of running an external program. I can't find anything in the forums or the Web site.
PsychBiller
 
Posts: 38
Joined: Sun Aug 05, 2012 9:45 am

Re: Example of using initscript.cmd with TBWinRE?

Postby TeraByte Support(PP) » Tue Jun 28, 2016 10:05 pm

The InitScript.cmd, RunScript.cmd and BuildScript.cmd files are all standard CMD scripts (batch files).

Assuming you're using TBWinPE/RE Builder and copy your recovery key .BEK file into the TBWinRE build folder, you could set it up as follows.

The BuildScript.cmd file would have a "copy" command to copy the BEK file into the build. (Don't include the ----------- lines.)
----------
copy "%TBWinPE_BuildPath%\BEKFile.bek" "%TBWinPE_MountPath%\Windows\System32"
----------
Of course, use the correct name for the .bek file.

The InitScript.cmd file would contain the manage-bde command to unlock the drive. You need to know the drive letter that gets assigned to the partition you need to unlock when you're booted into TBWinRE (C: is used below). As above, use the correct filename for the .bek file.
----------
%SystemDrive%\Windows\System32\manage-bde.exe -unlock c: -rk "%SystemDrive%\Windows\System32\BEKFile.BEK"
----------

If you want to be prompted for the password instead, you would use the following command:
----------
%SystemDrive%\Windows\System32\manage-bde.exe -unlock c: -pw
----------

In Builder's settings you would need to check the "Include InitScript.cmd" and "Include BuildScript.cmd" options to enable them.

Note: The above method will work when booting from a UFD. If booting to the installed WinRE an alternative method is required.
Paul Purviance
TeraByte Support
TeraByte Support(PP)
 
Posts: 1108
Joined: Thu Aug 11, 2011 5:51 pm

Re: Example of using initscript.cmd with TBWinRE?

Postby PsychBiller » Tue Jun 28, 2016 10:24 pm

This is fantastic, Paul. Thank you for such great detail!
PsychBiller
 
Posts: 38
Joined: Sun Aug 05, 2012 9:45 am


Return to Image for DOS/Linux/Windows