View Single Post
  #9  
Old September 17th 17, 05:33 PM posted to alt.windows7.general
JJ[_11_]
external usenet poster
 
Posts: 744
Default 32 & 64 bit Programs

On Sat, 16 Sep 2017 10:08:16 -0400, SteveGG wrote:
Is there an easy way to tell if an app is 32 or 64 ?

Probably answered before but can't recall ....


You can use below VBScript if you want. It only expect one command line
argument, which is a file path.

set fso = createobject("scripting.filesystemobject")
s = fso.getfile(wscript.arguments(0)).size
if s = 1024 then
set f = fso.opentextfile(wscript.arguments(0), 1, false, 0)
if f.read(2) = "MZ" then
f.read(58)
o = asc(f.read(1))
o = (asc(f.read(1)) * 256) + o
o = (asc(f.read(1)) * 65536) + o
o = (asc(f.read(1)) * 16777216) + o
f.read(o - 64)
if f.read(2) = "PE" then
f.read(2)
select case f.read(1)
case "L":
wscript.echo "File is a 32-bit Windows executable."
case "d":
wscript.echo "File is a 64-bit Windows executable."
case else:
wscript.echo "File is an unknown type of Windows executable."
end select
else
s = 0
end if
else
s = 0
end if
f.close
else
s = 0
end if
if s = 0 then
wscript.echo "File is not a valid Windows executable."
end if
Ads