Create a GPO Startup Script to check OS version and then run an installer package

So I need a script connected to a GPO that will run when our laptops startup.  it should check if the OS version is X64 or X32 and then run the installer of X32 or X64 depending on the outcome of the OS verification part of the script.  I have created a script below and placed in the net logon folder in a sub folder that contains both my script and the installer packages.  So I have the installer files for x32 and x64 as well as the "osverify.bat" file within the samew folder "\\\netlogon\namcredentialinstall" I added the script to GPO and set GPO to deploy on this OU for my test machine.  After bootup the installer had not run.  What have I got wrong?


@echo off

   start /b /wait NAMCredentialProvider.exe
   goto Done
) else (
  start /b /wait NAMCredentialProvider64.exe
  goto Done
echo Processor Architecture is %PROCESSOR_ARCHITECTURE%

timeout 15
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Michael ChisholmCommented:
First did you do a gpupdate /force and then reboot. then do a gpresult /z and verify of the gpo applies correctly and is not filtered out.

let me know the results

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
Michael ChisholmCommented:
On a side note the script will only need to check if the systems is 64bit. If it is not then the 32 script will run.
David Johnson, CD, MVPOwnerCommented:
I would use wmi filtering see my article on WMI Filtering in AD you would want a client os laptop x86 and client os laptop x64 filter
SD-WAN: Making It Work for You

As bandwidth requirements and Internet costs grow, businesses naturally want to manage budgets by reducing reliance on their most expensive connection types. Learn more about how to make SD-WAN work for your business in our on-demand webinar!

Twhite0909Author Commented:
Im new to scripting and adding them to GPO so I could be doing something wrong here.  I ran the GPUPDATE /FORCE then GPRESULTS /Z and I don't see it in here skipped or applied.  Ive added screenshots of the following

The .bat script
The GPO Location
 The GPO Startup settings under "machine"

What am I doing wrong?
Twhite0909Author Commented:
Woops I have attached the pics below.  My GPO is called "TWTEST"
Twhite0909Author Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for Twhite0909's comment #a40944171

for the following reason:

David Johnson, CD, MVPOwnerCommented:
PROCESSOR_ARCHITECTURE=AMD64 is the proper environmental variable.
where you got %PROCESSOR_ARCHITEW6432% from I have absolutely NO idea.

@echo off
IF (%Processor_Architecture% EQU "AMD64" (
rem    start /b /wait NAMCredentialPriver64.exe
echo Doing x64 install
	goto Done
 ) Else (
rem start /b /wait NAMCredentialPriver.exe
echo doing x86 install
echo Processor_Architecture is %processor_Architecture%
timeout 15

Open in new window

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.