Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Find Drive letter for program files (86)  (Read 14685 times)

0 Members and 1 Guest are viewing this topic.

oxicottin

    Topic Starter


    Rookie

    • Experience: Beginner
    • OS: Windows 7
    Re: Find Drive letter for program files (86)
    « Reply #30 on: February 10, 2013, 01:07:46 PM »
    So this would give me a better ida then...

    Code: [Select]
    @echo off
     
    Set RegQry=HKLM\Hardware\Description\System\CentralProcessor\0
     
    REG.exe Query %RegQry% > checkOS.txt
     
    Find /i "x86" < CheckOS.txt > StringCheck.txt
     
    If %ERRORLEVEL% == 0 (
        Echo "This is 32 Bit Operating system"
    ) ELSE (
        Echo "This is 64 Bit Operating System"
    )

    pause


    Quote
    HKEY_LOCAL_MACHINE\Hardware\Description\System\CentralProcessor\0
        Component Information    REG_BINARY    00000000000000000000000000000000
        Identifier    REG_SZ    Intel64 Family 6 Model 58 Stepping 9
        Configuration Data    REG_FULL_RESOURCE_DESCRIPTOR    FFFFFFFFFFFFFFFF0000000000000000
        ProcessorNameString    REG_SZ    Intel(R) Core(TM) i3-3110M CPU @ 2.40GHz
        VendorIdentifier    REG_SZ    GenuineIntel
        FeatureSet    REG_DWORD    0x3d193fff
        ~MHz    REG_DWORD    0x95b
        Update Revision    REG_BINARY    0000000015000000
        Update Status    REG_DWORD    0x7
        Previous Update Revision    REG_BINARY    0000000015000000
        Platform Specific Field 1    REG_DWORD    0x10

    Salmon Trout

    • Guest
    Re: Find Drive letter for program files (86)
    « Reply #31 on: February 10, 2013, 01:43:01 PM »
    You can just do this

    Code: [Select]
    @echo off
    Set OSBits=64
    IF %PROCESSOR_ARCHITECTURE%==x86 (
      IF NOT DEFINED PROCESSOR_ARCHITEW6432 Set OSBits=32
      )
    Echo Operating System is %OSBits% bit


    oxicottin

      Topic Starter


      Rookie

      • Experience: Beginner
      • OS: Windows 7
      Re: Find Drive letter for program files (86)
      « Reply #32 on: February 10, 2013, 05:05:31 PM »
      Salmon, could you explain "IF NOT DEFINED" please. I searched and I cant really find anything on it. Thanks! Also I added Foxidives code to save to temp and it works well. Thanks for that code as well Foxidrive!!

      Code: [Select]
      @echo off

      Color 2A

      Set OSBits=64

      del "%temp%\64bit.txt" 2>nul

      IF %PROCESSOR_ARCHITECTURE%==x86 (
        IF NOT DEFINED PROCESSOR_ARCHITEW6432 Set OSBits=32
        )
      Echo Operating System is %OSBits% bit do >"%temp%\64bit.txt"
      echo.

      Salmon Trout

      • Guest
      Re: Find Drive letter for program files (86)
      « Reply #33 on: February 11, 2013, 03:47:14 AM »
      You can use an IF test to see if a variable is "defined", i.e. if it has been declared, either by a SET statement or by the system (like %username%, etc) The test is IF DEFINED variablename command. As with all IF tests you can test for the opposite (if it has NOT been defined) by inserting the word NOT after the IF keyword. That variable only exists in a 64 bit session on a 64 bit system. Thus if it is not defined we might not have a 64 bit system.

      (You did know you can look all this kind of thing up on the web?) Type if defined batch into Google.

      oxicottin

        Topic Starter


        Rookie

        • Experience: Beginner
        • OS: Windows 7
        Re: Find Drive letter for program files (86)
        « Reply #34 on: February 11, 2013, 06:11:06 AM »
        (You did know you can look all this kind of thing up on the web?) Type if defined batch into Google.

        Yes I did a google search prior to asking. I think by searching the entire phrase gave me limited results. Thanks again!

        Quote
        Salmon, could you explain "IF NOT DEFINED" please. I searched and I cant really find anything on it.