Saved Bookmarks
| 1. |
Solve : Find Drive letter for program files (86)? |
|
Answer» So this would give me a better ida then... HKEY_LOCAL_MACHINE\Hardware\Description\System\CentralProcessor\0You 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. |
|