AutoIT script to detect if an Office 2010 Registry Key exists?

Hello

I am trying to write a small script that checks if a registry key exists.  If it does then if does one thing, and if not another.  This is being used to detect if Office 2010 Pro Plus is installed.

Attached is the script, but when its run it always says it can't find the key, even if it exists.

I'm going wrong somewhere in the RegRead command, if someone can help please?

When I look at the registry of a computer that has the software installed, there appears to be 2 versions of the key displayed:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90140000-0011-0000-0000-0000000FF1CE}

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90140000-0011-0000-0000-0000000FF1CE}_Office14.PROPLUS_{21DBCDE6-F8CF-4653-8995-CE7AC60097CF}

Any idea which one I should be searching for?

Thanks in advance
regcheck.txt
LVL 1
WolfAsked:
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.

Muhammad BurhanManager I.T.Commented:
first it verify misc.exe exist or not then run installer
@ECHO OFF
IF EXIST "%C:\Program Files (x86)\Microsoft Office\Office14\misc.exe" GOTO EXIT
\\<SMBshare\office\setup.exe>
:EXIT
0
WolfAuthor Commented:
I don't think that will work as I will be using it to eventually decide if Office 2010 standard should be removed, and Office 2010 pro installed, and the folder structure is the same Office14
0
WolfAuthor Commented:
I managed to get this to work by using the following command

If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90140000-0011-0000-0000-0000000FF1CE}", "DisplayName") = "Microsoft Office Professional Plus 2010" _
   Or RegRead("HKEY_LOCAL_MACHINE \Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{90140000-0011-0000-0000-0000000FF1CE}", "DisplayName") = "Microsoft Office Professional Plus 2010" _
	  Or RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\{90150000-0011-0000-0000-0000000FF1CE}", "DisplayName") = "Microsoft Office Professional Plus 2013" _
		 Or RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{90150000-0011-0000-0000-0000000FF1CE}", "DisplayName") = "Microsoft Office Professional Plus 2013" _
			Then
			   Exit(0)

Else

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
WolfAuthor Commented:
Managed to find the solution myself
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
Scripting Languages

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.