Page 4 of 4 <1234
Topic Options
#208453 - 2014-01-31 07:31 PM Re: Check for 32 or 64 bit [Re: Arend_]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 1996
Loc: Tulsa, OK
But thats why the second segment is also checked.

if $s="0011" or $s="011D" or $s="0012" or $s="0013" or $s="0014" or $s="002F"

Top
#208454 - 2014-01-31 08:09 PM Re: Check for 32 or 64 bit [Re: ShaneEP]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22298
Loc: OK
indeed.
_________________________
!

download KiXnet

Top
#208456 - 2014-01-31 08:16 PM Re: Check for 32 or 64 bit [Re: Lonkero]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1823
Loc: Hilversum, The Netherlands
How do you know those segments will always be correct?
Well batch wise I found a more dependable way for office versions, just the 32/64 bit thing for office I haven't figured out yet (just for the sake of doing it in batch, kix is easier off course).
 Code:
@ECHO OFF
FOR /F "tokens=3*" %%A IN ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe" /v Path') DO SET answer=%%A %%B
echo %answer% | findstr Office11
if errorlevel 1 (
    GOTO :12
) ELSE (
    GOTO :office11
)
:12
echo %answer% | findstr Office12
if errorlevel 1 (
    GOTO :13
) ELSE (
    GOTO :office12
)
:13
echo %answer% | findstr Office13
if errorlevel 1 (
    GOTO :14
) ELSE (
    GOTO :office13
)
:14
echo %answer% | findstr Office14
if errorlevel 1 (
    GOTO :END
) ELSE (
    GOTO :office14
)
:Office11
MSG * Found Office 2003
GOTO :END

:Office12
MSG * Found Office 2007
GOTO :END

:Office13
MSG * Found Office 2010
GOTO :END

:Office14
MSG * Found Office 2013
GOTO :END

:END
pause

Top
#208457 - 2014-01-31 09:49 PM Re: Check for 32 or 64 bit [Re: Arend_]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22298
Loc: OK
 Quote:

How do you know those segments will always be correct?


because that's how office installs? the appPath you are reading might exist in windows vista. or might not. should not exist in anything earlier. and you are still looking for an office application, not office.
so if you have custom install with word excluded because the installer hated it, your script would not see office.

now, I know my sku matching is not complete and I might improve it or just put a disclaimer that office older than 2007 is not supported.

the point still does come back to the "boys and girls" comment earlier. if it supposedly is so easy, why it takes many brains and days and still isn't done reliably?
and if we turn this around, it took me the whole 30 minutes to write an udf, test it and post it... well, maybe closer to an hour. I would say the UDF was thus easier and simpler than "simple batch script"
_________________________
!

download KiXnet

Top
#208458 - 2014-01-31 10:00 PM Re: Check for 32 or 64 bit [Re: Lonkero]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1823
Loc: Hilversum, The Netherlands
 Originally Posted By: Lonkero
 Quote:

How do you know those segments will always be correct?


because that's how office installs? the appPath you are reading might exist in windows vista. or might not. should not exist in anything earlier. and you are still looking for an office application, not office.
so if you have custom install with word excluded because the installer hated it, your script would not see office.

now, I know my sku matching is not complete and I might improve it or just put a disclaimer that office older than 2007 is not supported.

the point still does come back to the "boys and girls" comment earlier. if it supposedly is so easy, why it takes many brains and days and still isn't done reliably?
and if we turn this around, it took me the whole 30 minutes to write an udf, test it and post it... well, maybe closer to an hour. I would say the UDF was thus easier and simpler than "simple batch script"


Yeah, not so much, you forgot 008B for instance.

The App Path I am reading has existed since Windows 98, so no worries there.

If the Office installation does not contain Word, then we are by your definition not looking for an Office Suite at all, just loose applications :P

Didn't take many brains or time really, just saw this as something funny to do in the off minutes I had today and yesterday to brush up on my batch scripting.
All in all I used in total maybe 30 minutes.

Besides, 64-bit office is a hack anyway.

Top
#208459 - 2014-01-31 10:49 PM Re: Check for 32 or 64 bit [Re: Arend_]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11548
Loc: CA
Finding the 32-bit vs 64-bit is very doable in batch and I've not tested but I have to believe that either my code or Arends code for that works in batch. As far as finding the actual version of Office I never said that.
Top
#208460 - 2014-01-31 10:55 PM Re: Check for 32 or 64 bit [Re: NTDOC]
Allen Moderator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4272
Loc: USA
Maybe it's time we put this thread to rest.
Top
#208461 - 2014-01-31 11:01 PM Re: Check for 32 or 64 bit [Re: Arend_]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22298
Loc: OK
the difference between loose applications, like you are testing against and office is that office, when installed, does have OFFICE installed.
you can omit programs from the installation and those keys won't be there.
you can't omit office key, as it is what is installed.

you still can buy stand alone office products. I have no system setup like that so I do not know if office keys are omitted then. but if they were, my udf would work correct, as no office was installed. your batch would fail as it would report office installed when only certain component was there.

what comes to the app paths... I stand corrected. Learned something today.

oh, and the sku's on the bit check udf have been updated.


edit:
I am all for ending the debate. I did (and still do) have an issue how a certain remark implied on a kixtart board that the job at hand would be somehow easier/simpler/better if I would have had brains to do it in a batch instead.


Edited by Lonkero (2014-01-31 11:14 PM)
_________________________
!

download KiXnet

Top
#208463 - 2014-02-01 01:23 AM Re: Check for 32 or 64 bit [Re: Lonkero]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11548
Loc: CA
Comment was not directed specifically at anyone. There was already discussion and no one at the time had provided any code so I said that a folder could be checked in batch (meaning that if batch could do it then KiX could as well and probably easier) and I still say it can be checked with batch if wanted. Is it the best method - NO and I don't believe I or anyone else said it was the best method. Only said that batch could check that folder and I still say it can.

The UDF you provided Lonk is certainly a much more robust and appropriate coding to check on that.

/End for me...

Top
#208466 - 2014-02-01 02:47 PM Re: Check for 32 or 64 bit [Re: NTDOC]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1823
Loc: Hilversum, The Netherlands
All I wanted was to prove it could be done in batch.
Which works to an extend, as you (Lonkero) pointed out, it's never a sure shot, and your UDF is when it comes to Full Office products.

As far as putting this argument to rest, hell I haven't seen this board so alive as I did these last couple of days ;\)

Top
Page 4 of 4 <1234


Moderator:  Jochen, Allen, Radimus, Chris S., Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Jochen) and 187 anonymous users online.
Newest Members
MikeKrausnick, Ruggiero, xempa333, KroodjeBip, Thala
17470 Registered Users

Generated in 0.035 seconds in which 0.011 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org