Bits

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
BobDDstryr
Junior Coder
Posts: 38
Joined: Fri Oct 22, 2010 2:47 am

Bits

Post by BobDDstryr » Fri Dec 10, 2010 4:24 am

Quick question - is there an easy variable to tell what bits a current operating system is running (32 vs 64)?

The OS_ver variable returns NT.6.0.6002 for VistaSP2 - but it does so for both Vista32 and Vista64. By default, most programs are installed in Program Files for 32-bit and Program Files (x86) for 64-bit. I'd like my scripts to be able to work for both OSes, so ideally I'd like to have something like:

let>OS=BITS_VARIABLE
if>OS=32
let>location=Program Files
else
let>location=Program Files (x86)
endif

run>C:\%location%\program.exe


without needing to figure out what value OS should have every time.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Dec 10, 2010 10:22 am

Well, actually you shouldn't assume any format for the program files folder. What you should do is determine what it is:

See:
http://www.mjtnet.com/forum/viewtopic.php?p=23719

If you use this from Macro Scheduler the by default you should get whatever is the 32 bit program files folder. So you don't need to know if the system is 32 or 64 bit - that's a misnomer when what you REALLY want to know is "What is the path of the 32 bit program files folder". (for all you know someone has changed it to be c:\fred's programs).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

BobDDstryr
Junior Coder
Posts: 38
Joined: Fri Oct 22, 2010 2:47 am

Post by BobDDstryr » Fri Dec 10, 2010 7:28 pm

Thanks - that's even better!

And looking over GetEnvVar, it looks like if I need to get the bits to do something else, I can use:

GetEnvVar>Processor_Architecture,bits

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts