abcram Posted July 9, 2019 Share Posted July 9, 2019 (edited) ->Need to retrieve PC name and later change back to the original name Boot to Win PE (for Win 10 v1809 32bit) Need a script that will run in WinPE and do the following: Load the registry hive of the computer into WinPE Get the computer name from the registry (probably HKLM\System\CurrentControlSet\Control\ComputerName\ComputerName) Save the computer name to a temporary folder on the USB Partion & format the drive then install the image (my process). After Windows setup is complete, a new PC name will be generated, so need an additional script to: change the computer name back to the original name. NOTES: An underline will be used in the original name, so a warning about non-standard characters will be likely and a restart required for the name to change. When manually changing the name, the older process (like Win7) from Control Panel / System / Advanced System Settings / Computer Name tab / [Change] button works... but the simplified Windows 10 way (Setting / System / About / [Rename this PC]) does not allow the use of the underline in the PC name. Edited July 12, 2019 by abcram Link to comment Share on other sites More sharing options...
jaclaz Posted July 10, 2019 Share Posted July 10, 2019 Hmmm. Have you tried via wmic? https://www.windows-commandline.com/change-computer-name-command-line/ it still works (should) on Windows 10, where you have also the Powershell method available: https://www.tenforums.com/tutorials/5174-change-computer-name-windows-10-a.html Otherwise, if you really-really want to do it from the PE, try the Offline Registry Editor http://reboot.pro/topic/11212-offline-registry-library/ http://reboot.pro/topic/11312-offline-registry/ http://reboot.pro/topic/18527-offlinereg/ jaclaz Link to comment Share on other sites More sharing options...
Tripredacus Posted July 10, 2019 Share Posted July 10, 2019 Is this for home or business use? If in an enterprise environment, I would query the asset management system for the old computer name and then use powershell to rename the computer. No entry into WinPE needed. Link to comment Share on other sites More sharing options...
abcram Posted July 10, 2019 Author Share Posted July 10, 2019 Hi K-Mart yes its the enterprise environment Do you have the command to change or rename the computer from powershell Link to comment Share on other sites More sharing options...
jaclaz Posted July 10, 2019 Share Posted July 10, 2019 2 hours ago, abcram said: Hi K-Mart yes its the enterprise environment Do you have the command to change or rename the computer from powershell I ALREADY posted a link to it: https://www.tenforums.com/tutorials/5174-change-computer-name-windows-10-a.html anyway: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/rename-computer?view=powershell-6 Example: Rename-Computer -NewName "Server044" -Restart jaclaz Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now