-
1. Re: Looking for a VBS Script in Provisioning to Name Computer
cri Feb 25, 2014 11:34 AM (in response to tblancas)Hello, i'm not sure that LANDesk default WinPE include the scripting-package which allows VBS to run ?
But you could try this : http://community.landesk.com/support/docs/DOC-26995
I myself use an autoit script for this purpose.
-
2. Re: Looking for a VBS Script in Provisioning to Name Computer
tblancas Feb 25, 2014 11:39 AM (in response to cri)Thanks for replying but I already run a VBS in WinPE for automatic naming of computers. It uses the gatway for site code, serial or service tag then L or D with battery type that uses WMI.
-
3. Re: Looking for a VBS Script in Provisioning to Name Computer
cri Feb 25, 2014 1:09 PM (in response to tblancas)1 of 1 people found this helpfulOk, then here a quick example of what you can do :
strInput = InputBox( "Computer Name:" )
Const ForReading = 1
Const ForWriting = 2
UnattendFile = "c:\windows\panther\unattend.xml"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(UnattendFile, ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "<ComputerName>%ldHostname%</ComputerName>", "<ComputerName>"& strInput &"</ComputerName>")
Set objFile = objFSO.OpenTextFile(UnattendFile, ForWriting)
objFile.WriteLine strNewText
objFile.Close
It might need some changes, it depends of your unattend.xml and it's designed to work with WSCRIPT, not CSCRIPT.
-
4. Re: Looking for a VBS Script in Provisioning to Name Computer
tblancas Feb 25, 2014 2:36 PM (in response to tblancas)Thank you. Your post pointed me in the right direction. Got it finally.