Mar 032016

Making a stand alone image for a thin client has a few things missing like setting a computername. This is for the situation you do not have HP Device Manager but either way comes in handy when you image your clients with an USB-stick.

Screen 03-mrt 0000

You can easily add a visual basic script to the image that asks for the name when the image is deployed with these steps:

  1. First deploy the latest HP factory image to the thin client, adjust it to your business and make an image with HP Thinstate.
  2. Mount the Thinstate image
    DISM.exe /Mount-Wim /WimFile:"flash.ibr" /index:1 /MountDir:c:\mountdir
  3. Add the following vb script to the folder c:\mountdir\windows\setup\scripts\RenameComputerName.vbs
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colSMBIOS = objWMIService.ExecQuery ("Select * from Win32_SystemEnclosure")
    For Each objSMBIOS in colSMBIOS
    strSN = objSMBIOS.SerialNumber
    If strSN <> "" Then exit For
    Name = InputBox("Please enter the Computer Name:","Computer Name")
    Set colComputers = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
    For Each objComputer in colComputers
    err = objComputer.Rename(Name)
    if err <> 0 then
    wscript.echo "There was an error renaming the machine. Please restart, and try again."
    wscript.echo "Machine successfully renamed: " & Name
    end if
  4. add the following commandline to the script c:\mountdir\windows\setup\scripts\FirstLogon.cmd. Just anywhere before the reboot command
    REM Ask Computername
    cscript C:\Windows\Setup\scripts\RenameComputerName.vbs 1>nul 2>nul

    Screen 03-mrt 0002

  5. Unmount + commit the image and deploy!DISM.exe /Unmount-Wim /MountDir:%MNTDIR% /commit


 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>