Detecting XP64 versus XP32 – Autolisp Function

Do you need a function that detects whether AutoCAD is running under XP32 or XP64? I had the need today. This is what I came up with:

;;; Begin code

;;; =========================================================================
;;; Function: RLB:XP64Detector
;;; Purpose : Function to detect running under 64 or 32bit XP
;;; Author : Richard Binning
;;; Date : 4/10/2008
;;; Call : (RLB:XP64Detector “Wow6432Node”)
;;; Example : (if (= 0 (RLB:XP64Detector “Wow6432Node”))
;;; (alert “32 Bit Detected”)
;;; (alert “64 Bit Detected”)
;;; )
;;; Params : subKey: Name of XP64 With this condom, no sensation is lost, it is only enhanced. http://amerikabulteni.com/2017/10/29/japonyada-renkli-ama-tehlikeli-bir-sonbahar-festivali-danjiri/ levitra online However, it is noteworthy that the medication should be online viagra amerikabulteni.com taken at least 2 hours before any sexual activities. All of the research shows tomatoes are indeed pure heart and blood food. purchase generic levitra purchasing that The site always looks to provide the http://amerikabulteni.com/2012/04/20/judge-grants-george-zimmerman-bail/ levitra properien product in jelly form. Registry Key for installing 32bit apps
;;;
;;; Local : keyVal: Value of key sought
;;; : profileStr
;;; Returns : a number greater than 0 if running under XP64
;;; Notes : Placed in use to load correct version
;;; ================================================================================
(defun RLB:XP64Detector (subKey / keyVal retVal profilesStr)
(setq keyVal nil)
(setq profilesStr (strcat “HKEY_LOCAL_MACHINESOFTWARE” subKey))
(setq keyVal (reverse (vl-registry-descendents profilesStr)))
(vl-list-length keyVal); return value
)

;;; end code

Anyone like to test this under vista?

2 thoughts on “Detecting XP64 versus XP32 – Autolisp Function

  • July 8, 2008 at 08:27
    Permalink

    (setq pltfrm (getvar “platform”))
    (cond
    ((wcmatch pltfrm “*(x64)”)
    (setq pltfrm “64”)
    )
    ((wcmatch pltfrm “*(x86)”)
    (setq pltfrm “64”)
    )
    (T nil)
    ) ;_ENDc

  • July 31, 2008 at 07:56
    Permalink

    Thanks anonymous,

    Looks like there was a typo in the code you suggested. In the second condition if the pltfrm matches (X86) then the variable should be set to 32 not 64.

    This code works well in XP 32. I’ll try it in 64 bit vista this evening. Here is the corrected code:

    (setq pltfrm (getvar “platform”))
    (cond
    ((wcmatch pltfrm “*(x64)”)
    (setq pltfrm “64”)
    )
    ((wcmatch pltfrm “*(x86)”)
    (setq pltfrm “32”)
    )
    (T nil)
    ) ;_ENDc

    ~Richard

Leave a Reply