1.

Solve : Find Drive letter for program files (86)?

Answer»

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
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
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.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.
Quote from: Salmon Trout on February 11, 2013, 03:47:14 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.



Discussion

No Comment Found