LoginSignup
1
2

More than 5 years have passed since last update.

OS の bit数 を 判定する

Posted at

OSが64bit版か32bit版か判定する方法です。
プリンタドライバを PowerShell でインストールする際に、
使うべきドライバを判別するのに使用しています。


$os = Get-WmiObject -Class Win32_OperatingSystem
Write-Host $os.OSarchitecture

if ( $os.OSarchitecture -eq "64 ビット" )
  {
  Write-Host "64bit版OSです"
  }
else
  {
  Write-Host "32bit版OSです"
  }
# end
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2