c++ - Detect BIOS from WinPE: Legacy or UEFI, using vbs // Outputting results from a .exe to .txt -
here scenario:
i have server 2 possible configurations: 2-tb hdd require no special treatment or 3-tb hdd require uefi bios , gpt partition boot os.
i trying create single installation usb key able detect whether bios 'legacy' or 'uefi' , execute deployment script accordingly.
i looked hard wmi can make distinction no avail.
the closest came solution post: http://social.technet.microsoft.com/forums/en-us/winservermanagement/thread/6cbb488d-3062-4aad-b712-7a9e4d045b13
detectefi.exe works in detecting bios type, can't output result don't know how use it.
i have 2 questions:
is there wmi can use distinguich between 2 set-ups.
(if answer question 1 no) there way output results c++ compiled .exe file .txt or other form , make use of result (i have no c++ skills @ all)
if interested how fixed problem. created vbs linking .exe
set objshell = createobject("wscript.shell") set objwshscriptexec = objshell.exec("detectefi.exe") set objstdout = objwshscriptexec.stdout dim islegacy dim isuefi islegacy = false isuefi = false while not objstdout.atendofstream strline = objstdout.readline if strline = "legacy" islegacy = true end if if strline = "uefi" isuefi = true end if wend if islegacy wscript.echo "this legacy" set objshell = wscript.createobject("wscript.shell") objshell.run "2tbdeploy.cmd",1,true set objshell = nothing end if if isuefi wscript.echo "this uefi" set objshell = wscript.createobject("wscript.shell") objshell.run "3tbdeploy.cmd",1,true set objshell = nothing end if
Comments
Post a Comment