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

Answer Summary:
Cancel
3 Comments   [ + ] Show Comments

Comments

  • That's some good information! Thanks!

    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?
  • Okay, as I understand this script:

    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!
  • Ah, that's the info I was looking for! Thanks!
Please log in to comment

Answer Chosen by the Author


Please log in to comment

Answers

1
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
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

Answered 05/17/2016 by: SMal.tmcc
Red Belt

Please log in to comment
1
To learn the innards of the k2 you want good knowledge of OpenBCD, Samba, Dos commands, VB scripting, XML, HTA, AutoIT among others.  You can connect to your kbox's hidden samba shares and see all the working files with the samba password.
Answered 05/17/2016 by: SMal.tmcc
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity

Share