How To: Get the target computer name within WinPE during staging
  • KB ID: AA-00682
  • Created: 04/09/2013 10:41 AM
  • Updated: 04/10/2013 8:15 AM
  • Views: 6639
  • 0 Ratings

Summary

You need the computer name that the computer will get after staging but during WinPE the variable %COMPUTERNAME% is set to a random temporary name.


More Information

To get to the computer name the most easy way is to create an OS Deploy job with a SPECIAL.BAT with the following content:

@ECHO OFF
X:
CD ASETUP
FOR /f "tokens=3 delims=><  " %%a IN ('TYPE unattend.xml ^| FIND "<ComputerName>"') DO SET NEWCOMPUTERNAME=%%a
ECHO %NEWCOMPUTERNAME%

After running this job, the name can be accessed using the %NEWCOMPUTERNAME% variable

Keywords

WinPE, %COMPUTERNAME%, Computername


Products

C6, C7


Feedback

Did you find this article helpful?

© 2000-2018 Brainware Consulting & Development AG     Impressum / Legal Notice  |  Datenschutz / Privacy Policy