GPO -Login Script to determine if Computer is X32 or X64

So we have a login script with GPO to run an install but we also need a login script to deploy via CPO to determine if the machine is a 64bit or 32 bit.  Any ideas?
Twhite0909Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

eastmsCommented:
I've had luck with a .bat like this

@echo off
Set ARCHITECTURE=x86
If Exist "%SystemDrive%\Program Files (x86)" Set ARCHITECTURE=x64
Echo OS is %ARCHITECTURE%
:END

Open in new window


This is the simplest way we've found but you can also query the registry or use WMI
0
MasonWexlerCommented:
Here's Windows Script Host (WSH) code.

Option Explicit

Wscript.Echo GetOSType()

Function GetOSType()
   Dim objWMIService, colItems, objItem
   Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
   Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem")
   For Each objItem In colItems
       GetOSType = objItem.OSArchitecture
   Next
End Function 

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Twhite0909Author Commented:
So if i were to go with the .bat which I like I can save as .bat on DC under the scripts locations then open GPO editor  USER config-windows settings-scripts-Logon properties   browse for that .bat add and apply.

Next time I log off and on the system will measure if im 32 or 64bit.

Correct?
0
Introducing the "443 Security Simplified" Podcast

This new podcast puts you inside the minds of leading white-hat hackers and security researchers. Hosts Marc Laliberte and Corey Nachreiner turn complex security concepts into easily understood and actionable insights on the latest cyber security headlines and trends.

eastmsCommented:
yea, that's the idea.  add a pause to the end for sanity check.  you may need to run 'gpupdate /force' first
0
FlippCommented:
GPO filter?
0
David Johnson, CD, MVPOwnerCommented:
I normally use wmi filtering
0
Twhite0909Author Commented:
So I now need this script to determine the architecture of the OS 932 or 64) and then launch a windows installer executable for which the system is 32 or 64.  I'm pretty new to scripting so how can I add the script above and have it say recognize a system is OS 32 bit then launch the 32 bit installer for for this application?
0
Twhite0909Author Commented:
Can one entire script handle that or would it need to be split?  Would something like this work?  I found the end part when researching.  My files "NAMCredentialProvider.exe are located under a folder in Netlogon so Id also need to have it point to those executables?

Option Explicit

Wscript.Echo GetOSType()

Function GetOSType()
   Dim objWMIService, colItems, objItem
   Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
   Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem")
   For Each objItem In colItems
       GetOSType = objItem.OSArchitecture
   Next
if exist "%SYSTEMDRIVE%\Program Files (x86)\" (
   start "" /d "%~dp0" "NAMCredentialProvider64.exe"
) else (
   start "" /d "%~dp0" "NAMCredentialProvider.exe"
)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.