Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8047867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:14:34+00:00 2026-06-05T06:14:34+00:00

Here is my scenario: I have a server with 2 possible configurations: 2-TB HDD

  • 0

Here is my scenario:

I have a server with 2 possible configurations: 2-TB HDD which require no special treatment or 3-TB HDD that require a UEFI BIOS and a GPT partition to boot the OS.

I am trying to create a single installation USB key that is able to detect whether the BIOS is ‘legacy’ or ‘UEFI’ and execute a deployment script accordingly.

I looked hard for a WMI that can make the distinction but to no avail.

The closest that I came to a solution is this post:
http://social.technet.microsoft.com/Forums/en-US/winserverManagement/thread/6cbb488d-3062-4aad-b712-7a9e4d045b13

detectefi.exe works perfectly in detecting the BIOS type, but I can’t output its result so I don’t know how to use it.

I have 2 questions:

  1. is there any WMI that I can use to distinguich between my 2 set-ups.

  2. (if the answer for question 1 is no) is there a way to output the results from a C++ compiled .exe file to .txt or any other form and make use of the result (I have no C++ skills at all)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:14:36+00:00Added an answer on June 5, 2026 at 6:14 am

    If anyone is interested how I fixed the problem. I just created a vbs linking to the .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" then
          isLegacy = true
       end if
    
       if strLine = "UEFI" then
          isUefi = true
       end if
    Wend
    
    
    if isLegacy then
       wscript.echo "this is legacy"
    
        set objShell = Wscript.CreateObject("WScript.Shell")
        objShell.Run "2TBdeploy.cmd",1,True
        set objShell = Nothing
    
    end if
    
    
    if isUefi then
       wscript.echo "this is UEFI"
    
        set objShell = Wscript.CreateObject("WScript.Shell")
        objShell.Run "3TBdeploy.cmd",1,True
        set objShell = Nothing
    
    end if
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the scenario: You have a Windows server that users remotely connect to via
Here is the scenario: I have a visual that displays some data The data
Here's the scenario: I have a private site that, once logged on, will display
Here is the scenario: I have an object called a Transaction that needs to
Here is my scenario: I have a document, currently a FlowDocument, that I would
Here's the scenario: I'd like to have a host class that can have a
Here is the scenario: I have a table that records the user_id, the module_id,
Here's my scenario: I have two tables A, B which (for the sake of
Here is my scenario: I have a static object which will connect to a
Here's my scenario - I have an SSIS job that depends on another prior

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.