Jump to content

Recommended Posts

Posted

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.

Posted

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"

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...