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


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:



Any idea which one I should be searching for?

Thanks in advance
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
IF EXIST "%C:\Program Files (x86)\Microsoft Office\Office14\misc.exe" GOTO EXIT
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
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" _


Open in new window

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
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.