+ Post New Thread
Results 1 to 3 of 3
Scripts Thread, Open versions of Office Script in Coding and Web Development; Hi I had a batch script that was converted to an EXE that searched for different versions of Office programs ...
  1. #1
    jgcracknell's Avatar
    Join Date
    Mar 2009
    Location
    Somewhere
    Posts
    93
    Thank Post
    5
    Thanked 1 Time in 1 Post
    Rep Power
    21

    Open versions of Office Script

    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.

  2. #2


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,808
    Thank Post
    262
    Thanked 2,968 Times in 2,183 Posts
    Rep Power
    847
    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
    Code:
    #NoTrayIcon
    #AutoIt3Wrapper_UseX64=n
    
    $AppPath = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe", "Path") & "WinWord.exe"
    Run($AppPath, "", @SW_MAXIMIZE)
    RunWord.cmd
    Code:
    @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"

  3. #3
    jgcracknell's Avatar
    Join Date
    Mar 2009
    Location
    Somewhere
    Posts
    93
    Thank Post
    5
    Thanked 1 Time in 1 Post
    Rep Power
    21
    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...



SHARE:
+ Post New Thread

Similar Threads

  1. What do all the different versions of Vista do
    By SimpleSi in forum Windows Vista
    Replies: 14
    Last Post: 7th April 2008, 06:52 PM
  2. MS Word 2003 (as part of Office 2003) Printing Problems...
    By markwilliamson2001 in forum Windows
    Replies: 2
    Last Post: 22nd November 2007, 02:06 PM
  3. Different versions of Promethean boards
    By beeswax in forum Hardware
    Replies: 37
    Last Post: 16th January 2007, 02:19 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •