Hi. I'm looking for a cmd file detect if the system kernel x64 or x32 , becuse itry with this batch and it did't work , my plan is to add windows 7 driver cd's in AIO win 7 dvd vi setupcomplete.cmd but the problem is the too diffrent sourse of os , here is the setupcomplete.cmd sample what i use to run the drivers instaler : Code: echo off echo Detecting OS processor type :-------------------------------- if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto 64BIT echo 32-bit OS %~dp0"wandrv32.exe" goto END :64BIT echo 64-bit OS %~dp0"wandrv(64).exe"
Maybe this work better ? Code: start /b /wait powershell.exe -command "$ARCH = (Get-WmiObject -class Win32_OperatingSystem | Select-Object OSArchitecture).OSArchitecture;If ($ARCH -eq '64-bit') {Write-Host $ARCH;.\wandrv64.exe}else{Write-Host $ARCH;.\wandrv32.exe}" #
It seems you did not understand what I mean. I asked it to integrate the cmd whit an un attended windows 7 dvd
This works fine on my x64, (at least for echoing the correct bit-ness), problem must be your file-names. Why parentheses in the (64) in the file, but no parentheses in the 32 bit ? Code: @ECHO OFF echo Detecting OS processor type :-------------------------------- if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto 64BIT echo 32-bit OS %~dp0wandrv32.exe goto END :64BIT echo 64-bit OS %~dp0wandrv(64).exe PAUSE
I struggled with this for some time then realized that if "C:\Program Files (86)" is present (cmd file IF EXISTS ....) then this is x64 Windows.
Hi evryone agin ' itry all this on VHD and itd't work corctly seems to something rong whith it can any body add anew way to test it >
To avoid any irritations i'm using my own variables. within my helper.cmd I definied programfiles like this... Code: ::Programfiles if [%PROCESSOR_ARCHITECTURE%] == [AMD64] ( set "pf86=%programfiles(x86)%" set "pf64=%programfiles%" ) else ( set "pf86=%programfiles%" ) with this easy few lines I'm always sure that I'm pointing to the right directory. maybe this is something for you.
This is what I use to install my OS: Code: if %processor_architecture% == AMD64 \Source.x64\setup /unattend:%PTH%Files\Unattend-BIOS.xml if %processor_architecture% == x86 \Source.x86\setup /unattend:%PTH%Files\Unattend-BIOS.xml If you have both 32 & 64 bit executable's, you can rename them & call them from your batch: Files: Recoverx86.exe & RecoverAMD64.exe Code: @echo off Recover%processor_architecture%
@echo off mode con lines=10 cols=40 IF EXIST "%ProgramFiles(x86)%" goto 64bit IF EXIST "%ProgramFiles%" goto 32bit :64bit ECHO. ECHO. echo. Your Operating System is 64bit. ping localhost -n 4 >nul exit /b :32bit ECHO. ECHO. echo. Your Operating System is 32bit. ping localhost -n 4 >nul exit /b
3-Way OS Check Most of the listed methods will work but I prefer to check for a file rather than Programs x86 , I ran across a system last year where someone made a X86 directory with a 32-bit system so it would error out, also the AMD method is good for AMD systems but there are also Intelx64 systems as well, and last the ping is a old carry over from XP so I perfer to use the timeout command..Here is a 3-way check that should give you your basic info you can use all or cherry pick out what you want..DP Code: @echo off&color 1f&mode con:cols=68 lines=8 :: 3-Way Check for Bitness, OS Version and Full or Upgrade :: 02.18.14 ~DosProbie :: ### Ck Windows OS Version.. for /f "usebackq tokens=1,* delims==" %%a in (`wmic os get caption /format:list ^| findstr "^Caption="`) do ( set %%a=%%b ) title, %Caption% :: ### Ck If Windows OS Is Full or Upgrade Version.. set regpath=hklm\software\microsoft\windows\currentversion\setup\oobe set regvalue=MediaBootInstall set regdata=1 reg query "%regpath%" /v "%regvalue%" | findstr /r "%regdata%">nul 2>&1 cls :: ### OUTPUT IF FULL OR UPGRADE.. if "%errorlevel%" equ "1" ( title, %Caption%is a Full Version! ) else ( title, %Caption%is a Upgrade Version! ) :: ### Ck OS Bitness.. if exist "%systemroot%\syswow64\cmd.exe" (call :x64) else (call :x86) :x86 echo %Caption%32-bit OS.. && timeout /t 5 >nul ::< code > exit :x64 echo %Caption%64-bit OS.. && timeout /t 5 >nul ::< code > exit
There ain't no 'AMD'-Method, even an Intel system will give out 'AMD64'. Running an Intel i5 here . Code: C:\Windows\System32>reg query "HKLM\System\CurrentControlSet\Control\Session Man ager\Environment" /v "PROCESSOR_ARCHITECTURE" HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment PROCESSOR_ARCHITECTURE REG_SZ AMD64
My req query reads as follows: Code: PROCESSOR_ARCHITECTURE = x86 PROCESSOR_IDENTIFIER = x86 Family 6 Model 42 Stepping 7, GenuineIntel
Yes, s1ave77 is totally correct. If processor_architecture = AMD64 then your running a 64bit OS. It has nothing to do with Intel or AMD!