Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/28/2022 in all areas

  1. FYI if you don't release "htmlfile" it could so some funky things after multiple copies. ;;MP ;;http://www.theswamp.org/index.php?topic=21764.msg263322#msg263322 (defun _GetClipBoardText( / htmlfile result ) (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'GetData "Text")) (vlax-release-object htmlfile) )
    1 point
  2. Maybe (virtual serial): (defun HDSerial ( drive / fso drv ser ) (vl-catch-all-apply (function (lambda nil (setq fso (vlax-create-object "Scripting.FileSystemObject") drv (vlax-invoke-method fso 'getdrive drive) ser (vlax-get-property drv 'serialnumber) ) ) ) ) (if drv (vlax-release-object drv)) (if fso (vlax-release-object fso)) ser ) Or, for the manufacturer's Serial number (only works in Vista or 7): (defun HDSerial ( / wmi srv drv ser ) (vl-catch-all-apply (function (lambda ( ) (if (setq wmi (vlax-create-object "WbemScripting.SWbemLocator") srv (vlax-invoke wmi 'connectserver nil nil nil nil nil nil nil nil) drv (vlax-invoke srv 'execquery "Select SerialNumber from Win32_DiskDrive") ) (vlax-for item drv (vlax-for prop (vlax-get item 'Properties_) (if (eq "SERIALNUMBER" (strcase (vlax-get prop 'name))) (setq ser (vl-string-trim " " (vlax-get prop 'value))) ) ) ) ) ) ) ) (if drv (vlax-release-object drv)) (if srv (vlax-release-object srv)) (if wmi (vlax-release-object wmi)) ser )
    1 point
×
×
  • Create New...