Results 1 to 13 of 13
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Easy way to distinguish between Office versions? (2000/2003)

    Is there *one* file that I could search for to distinguish if a computer had Office 2003 installed? I'm writing a batch file so that I can apply updates across the network, and I'd like to split my machines into two groups...O2k and O2k3. We don't have the hardware to do a full upgrade to O2k3 (which would simplify my life), so I'm stuck doing this. Here's an example of the batch file:

    @echo off
    if exist C:WINDOWSsystem32MacromedFlashFlash9.ocx echo %computername% >> usmc_nfstranspoflashgood.txt
    if not exist C:WINDOWSsystem32MacromedFlashFlash9.ocx echo %computername% >> usmc_nfstranspoflashbad.txt

    Also, is there a way to echo the computer IP instead of name?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Easy way to distinguish between Office version

    Microsoft Office 2003 tends to sit in C:Program FilesMicrosoft OfficeOFFICE11 for most default installs

    @echo off
    if exist C:Program FilesMicrosoft OfficeOFFICE11winword.exe echo %computername% >> usmc_nfstranspoflashgood.txt
    if not exist C:Program FilesMicrosoft OfficeOFFICE11winword.exe echo %computername% >> usmc_nfstranspoflashbad.txt

    I think that will do the job
    Jerry

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Easy way to distinguish between Office versions? (2000/2003)

    The default install path for Office 2000 is C:Program FilesMicrosoft OfficeOffice, and that for Office 2003 is C:Program FilesMicrosoft OfficeOffice11. So, assuming the install path hasn't been customized, you could use

    if exist "C:Program FilesMicrosoft OfficeOffice11" ...

  4. #4
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Easy way to distinguish between Office version

    As for the IP address you may want to look at the code here to strip some ideas out
    Jerry

  5. #5
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Easy way to distinguish between Office version

    I figured out the Office11 folder about 1/2 second before you posted... Thank you both, and thanks for the link Jezza.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  6. #6
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Easy way to distinguish between Office versions? (2000/2003)

    Here's the final product....no IPs, but computer name will work:

    @echo off
    if exist "C:Program FilesMicrosoft OfficeOFFICE11WINWORD.EXE" GOTO GOOD
    if not exist "C:Program FilesMicrosoft OfficeOFFICE11WINWORD.EXE" GOTO BAD
    :GOOD
    echo %computername% >> usmc_nfstranspoupdatesoffice2003.txt
    GOTO END
    :BAD
    echo %computername% >> usmc_nfstranspoupdatesoffice2000.txt
    GOTO END
    :END
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  7. #7
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Easy way to distinguish between Office version

    Very nice Jeremy,

    Hans' version is different to mine as I specifically point to winword.exe as I assume that winword would be installed from a default installation. I am going to assume you would have that in your kind of business. However it can be just as acceptable to get it to just check C:Program FilesMicrosoft OfficeOFFICE11 is present as this could contain various installation variations.

    Not expecting you to change at this late stage but I thought I would add this to the thread.
    Jerry

  8. #8
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Easy way to distinguish between Office version

    You can easily extract the IP address from what is returned from a PING -- but surely IP address is a bit more changeable than computername, if you are using DHCP? I've never had any enthusiasm at all for working with the IP address of a computer!

    John

    PS Rob Van Der Woude's BATch file was well before the delights of Command Extensions, which increased the power of BATch files enormously!

    I would reword your BATch file to become:
    <pre>@echo off
    if exist "C:Program FilesMicrosoft OfficeOFFICE11WINWORD.EXE" (
    echo %computername% >> usmc_nfstranspoupdatesoffice2003.txt
    ) else (
    echo %computername% >> usmc_nfstranspoupdatesoffice2000.txt
    )</pre>

    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  9. #9
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Easy way to distinguish between Office version

    <img src=/S/nope.gif border=0 alt=nope width=15 height=15> No DHCP, simply because the more work required by the civilian contractors, the more $ they get, so they've locked the computers to specific ports and IPs....moving your computer across the office locks the machine and the port (calling it a security feature) and requires the civilian company to reassign IPs to the machines and reactivate the port. Something like $150.00 each time. Thanks for your help guys; I knew the OFFICE11 would be a more broad way to search, but I also knew that winword.exe wouldn't have moved...the military is so...militaristic.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  10. #10
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Easy way to distinguish between Office version

    Civilians ehh <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    I am renowned in my office for "blowing" ports as I tend to use Virtual PC's and have a virtual server. The security settings have been set to if the IP address at the port changes within a certain time it locks.

    One of the network guys came up with a very technical solution of a bright yellow post-it note which read "USE THIS <img src=/w3timages/censored.gif alt=censored border=0> PORT JEZZA" that port has been set as the non-secured point jus' for lil' ol' me <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Jerry

  11. #11
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Easy way to distinguish between Office version

    Here's a quick-and-dirty BATch file to get IP address from pc name, supplied as the BATch file parameter <pre>:: Get IP From Ping - parameter is the pc name whose IP address is wanted
    set forcmd=ping -n 1 %1 ^^^| find "Pinging"
    for /f "tokens=3 delims=[] " %%a in ('%forcmd%') do set IP=%%a
    echo %ip%</pre>

    It should work (via WINS, is it?) even if the PC is off, but as given it doesn't check that you've supplied the PC name or that the PC name is correct (i.e. is PINGable).

    John

    PS If you're running this BATch file on the target PC itself, replace %1 by %computername%, of course!
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  12. #12
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Easy way to distinguish between Office version

    >> PS If you're running this BATch file on the target PC itself, replace %1 by %computername%, of course!

    So using PSEXEC, I'd omit the -c switch IOT run the BATch file from my file server, or include the -c switch and use %computername%, correct?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  13. #13
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Easy way to distinguish between Office version

    I would say so; %computername% of course relates to the PC on which the program (BATch file, whatever) is running.

    In the immortal and frequently-encountered words of the late-lamented FidoNet bulletin board's BATPOWER forum, "Why don't you try it?" (with something non-life-threatening)!

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

Posting Permissions

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