New
#1
Need a script to change the name of a computer
About to roll out a bunch of VM's onto a domain, but I need to know how to automate a computer name change based on a variable BEFORE it joins the domain.
I've got a cmd script in SetupComplete.cmd that goes to a website to get a hostname based on the computers IP.
So is there any way to automate a script to get the variable and assign it as the host name?
This is the script I use to get the hostname. It assigns the hostname to the variable VMHOST.
Code:for /f "delims=" %a in ('c:\windows\system32\webfetch.exe websiteurl.php') do @set VMHOST=%a