Scripting Question

Get/Set Computer Name on Image Fail.

So I've been using the built in K2000 Get and Set computer name scripts and generally they work well. However if the imaging process fails and needs to be reran the name of the machine is lost. This is especially bad in my case since I have to image multiple labs.

Is there any way to have the name of the machine not get lost in case the imaging process fails and needs to be restarted?

Comments

All Answers

the built in get script writes to X: which is the ram drive in memory. so a reboot- kiss that good bye

Set compNameFile = fso.CreateTextFile("X:\" & macAddress, True)

you would need to create a modifed get set pair of scripts that go to a mapped drive instead to keep this info. I use windows shares to deploy my wims so I could write to the same share as the wims are stored.

Thanks. I ended up saving to the T:\ drive and checking if the file already existed.

Here were my changes to the GetComputerName.vbs file

'Dump the computer name into a file named as the mac address inside X:
If fso.DriveExists("T:") then
'Get mac adress
Set objSysEnv = wshShell.Environment("PROCESS")
macAddress = objSysEnv("MAC_ADDRESS")

If fso.FileExists("T:\" & macAddress) Then
WScript.Quit
Else
Set compNameFile = fso.CreateTextFile("T:\" & macAddress, True)
End If

Share

This website uses cookies.
By continuing to use this site and/or clicking the "Accept" button you are providing consent
Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our
websites or when you do business with us. For more information about our
Privacy Policy and our data protection
efforts, please visit
GDPR-HQ