jgcracknell Posted September 18, 2011 Posted September 18, 2011 Hi I had a batch script that was converted to an EXE that searched for different versions of Office programs and then opened the right one. e.g. for Word it would look for say Office14\Word.exe - if so would run it and end - if not it would continue and look for Office13\Word.exe and end and so on. Could someone please write me the basics for this to find a program of one version, if not to open the other version.
Arthur Posted September 18, 2011 Posted September 18, 2011 Here are a couple of scripts which should do what you want. The first is an AutoIt script and the second is a batch file. RunWord.au3 #NoTrayIcon #AutoIt3Wrapper_UseX64=n $AppPath = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe", "Path") & "WinWord.exe" Run($AppPath, "", @SW_MAXIMIZE) RunWord.cmd @ECHO OFF FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe" /v Path') DO SET AppPath=%%B START "" "%AppPath%WinWord.exe"
jgcracknell Posted September 21, 2011 Author Posted September 21, 2011 Hi The RunWord.cmd I found with XP I had to add in more to the AppPath - yet it works straight away with Win 7. The additional to the AppPath I had to add was c:\program files\microsoft\microsoft - rest OK...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now