What does "Fix BCD" do?
I've taken over the K2000 imaging role in my organization, and I'm pretty unfamiliar with the whole KACE environment.
In trying to deploy a Windows 10 image, I notice in the Details of the "Manual Deployment" progress log that there are several steps I did not put in my deployment "script", such as "Fix BCD".
After googling exhaustively, all I've found was a slide-show (http://www.slideshare.net/DellSoftware/dwuf15-k2000-troubleshooting) (that mentions briefly that this step "sets the correct boot and windows drives", which really doesn't tell me much about what this step does or how it does it.
So, my questions:
1. What exactly does this step of "Fix BCD" do, and how does it do it?
2. How does one go about learning the innards of these steps that KACE apparently does in the background but apparently does not document?
Thanks!
/Kent
In trying to deploy a Windows 10 image, I notice in the Details of the "Manual Deployment" progress log that there are several steps I did not put in my deployment "script", such as "Fix BCD".
After googling exhaustively, all I've found was a slide-show (http://www.slideshare.net/DellSoftware/dwuf15-k2000-troubleshooting) (that mentions briefly that this step "sets the correct boot and windows drives", which really doesn't tell me much about what this step does or how it does it.
So, my questions:
1. What exactly does this step of "Fix BCD" do, and how does it do it?
2. How does one go about learning the innards of these steps that KACE apparently does in the background but apparently does not document?
Thanks!
/Kent
3 Comments
[ + ] Show comments
Answers (3)
Answer Summary:
Please log in to answer
Posted by:
SMal.tmcc
8 years ago
fix bcd is application #35 in my kbox
<Task ID="35">
<Name>Fix BCD</Name>
<WorkingDirectory>Y:\applications\35</WorkingDirectory>
<CommandLine><![CDATA[fix_bcd.vbs]]></CommandLine>
<Parameters></Parameters>
<PostTaskAction>None</PostTaskAction>
<KACETaskType>Windows Script</KACETaskType>
<FileType>VBScript</FileType>
<Type>PO</Type>
<Guid>156672c16741f6</Guid>
</Task>
the task is a VB Script
<Task ID="35">
<Name>Fix BCD</Name>
<WorkingDirectory>Y:\applications\35</WorkingDirectory>
<CommandLine><![CDATA[fix_bcd.vbs]]></CommandLine>
<Parameters></Parameters>
<PostTaskAction>None</PostTaskAction>
<KACETaskType>Windows Script</KACETaskType>
<FileType>VBScript</FileType>
<Type>PO</Type>
<Guid>156672c16741f6</Guid>
</Task>
the task is a VB Script
Option Explicit
Dim xmlDoc
Dim envVarFile
Dim varList, varNode
Dim name
Dim value
Dim objShell, objFSO
Dim command, errorCode
Dim dictionary
' Environment variables file will be in the same place each time.
envVarFile = "X:\KACE\Engine\EnvVars.xml"
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.Load(envVarFile)
Set varList = xmlDoc.SelectNodes("//BootAction/EnvironmentVariables/EnvironmentVariable")
Set dictionary = CreateObject("Scripting.Dictionary")
For Each varNode in varList
name = varNode.SelectSingleNode("Name").Text
value = varNode.SelectSingleNode("Value").Text
dictionary.add name, value
Next
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(dictionary.Item("IMG_BOOT_DRIVE") & "\boot\bcd") Then
command = "cmd /c bcdedit.exe /store " & dictionary.Item("IMG_BOOT_DRIVE") & "\boot\bcd /set {bootmgr} device partition=" & dictionary.Item("IMG_BOOT_DRIVE")
errorCode = objShell.Run(command, 0, True)
command = "cmd /c bcdedit.exe /store " & dictionary.Item("IMG_BOOT_DRIVE") & "\boot\bcd /set {default} device partition=" & dictionary.Item("IMG_SYSTEM_DRIVE")
errorCode = objShell.Run(command, 0, True)
command = "cmd /c bcdedit.exe /store " & dictionary.Item("IMG_BOOT_DRIVE") & "\boot\bcd /set {default} OSdevice partition=" & dictionary.Item("IMG_SYSTEM_DRIVE")
errorCode = objShell.Run(command, 0, True)
End If
Posted by:
SMal.tmcc
8 years ago
Posted by:
SMal.tmcc
8 years ago
Top Answer
see my answer here for accessing the share
http://www.itninja.com/question/big-task-kace-k2000-deploy-two-windows-partitions-with-separate-post-installationtasks
http://www.itninja.com/question/big-task-kace-k2000-deploy-two-windows-partitions-with-separate-post-installationtasks
But where do I find this "application #35", and its resultant VBscript? Do I have to map a drive to the samba share, or is it accessible via the web interface? - kentwest 8 years ago
The first half does script house-keeping. The real magic is in the If-Then segment.
If the [drive:]\boot\bcd file exists, then...
1. Use the bcdedit /set command to set the bcd store (config file) located at [drive:]\boot\bcd to record the boot-drive as the place for the boot manager.
2. Set the system drive s the default booting OS.
3. Set the system drive as the main OS partition.
I'd still appreciate someone telling me how to find this VB script on my kbox. Thanks! - kentwest 8 years ago