Author Topic: found a function: get-logical-drives  (Read 1452 times)

0 Members and 1 Guest are viewing this topic.

baitang36

  • Bull Frog
  • Posts: 213
found a function: get-logical-drives
« on: August 08, 2021, 07:44:05 AM »
Using this function, you can get all drive letters.
However, this function is a reserved function of AutoCAD and is not written to public documents. It can only be invoked in Fas and can not be used in LSP.
An example is attached

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: found a function: get-logical-drives
« Reply #1 on: August 08, 2021, 08:29:33 AM »
should be able to do this via COM and WMI service
see https://docs.microsoft.com/en-us/windows/win32/wmisdk/wmi-tasks--disks-and-file-systems

edit "Scripting.FileSystemObject" Drives collection maybe
« Last Edit: August 08, 2021, 08:41:27 AM by It's Alive! »

mm_clover

  • Mosquito
  • Posts: 6
Re: found a function: get-logical-drives
« Reply #2 on: August 08, 2021, 09:21:42 AM »
谢谢分享Thank you for sharing!

Rod

  • Newt
  • Posts: 185
Re: found a function: get-logical-drives
« Reply #3 on: August 08, 2021, 06:16:18 PM »
Cool baitang36

If anyone is looking for an uncompiled alternative HighFlyingBird has created sometheing
http://www.theswamp.org/index.php?topic=38102.msg431146#msg431146

Cheers, Rod.
"All models are wrong, some models are useful" - George Box

BIGAL

  • Swamp Rat
  • Posts: 1396
  • 40 + years of using Autocad
Re: found a function: get-logical-drives
« Reply #4 on: August 08, 2021, 09:45:30 PM »
You can find drives

Code: [Select]
; drive type 1 is a usb 2 hard disk

(defun UsbDriveSerialNumber ( / fso dr)
  (setq fso (vlax-create-object "Scripting.FileSystemObject"))
  (vlax-for d (vlax-get fso 'Drives)
    (if
  (= (Vlax-get  d 'DriveType) 2)
      (setq dr (cons (list (vla-get-path d) (vla-get-SerialNumber d)) dr)
      )
    )
  )
  (vlax-release-object fso)
  (reverse dr)
)
(UsbDriveSerialNumber)
A man who never made a mistake never made anything

baitang36

  • Bull Frog
  • Posts: 213
Re: found a function: get-logical-drives
« Reply #5 on: August 10, 2021, 03:19:29 AM »
You can find drives

Code: [Select]
; drive type 1 is a usb 2 hard disk

(defun UsbDriveSerialNumber ( / fso dr)
  (setq fso (vlax-create-object "Scripting.FileSystemObject"))
  (vlax-for d (vlax-get fso 'Drives)
    (if
  (= (Vlax-get  d 'DriveType) 2)
      (setq dr (cons (list (vla-get-path d) (vla-get-SerialNumber d)) dr)
      )
    )
  )
  (vlax-release-object fso)
  (reverse dr)
)
(UsbDriveSerialNumber)
thank you

d2010

  • Bull Frog
  • Posts: 323
Re: found a function: get-logical-drives
« Reply #6 on: August 10, 2021, 05:49:39 AM »
How to inject userCPU-ID-codes directly to programe_jc_aro10.Lsp.Txt??

Eu am nevoie de ajutor, sa compilam sursa LISP blochata pe seriaL CPU-id
Daca sursa este compilata pe serial CPU-ID, atunci chair Tu nu poti executa
programe.LSP.txt chiar in calculatorul baitang36Win10.

How to encrypt programe.Lsp.Txt with  only, once CPU-ID-code,before FAs or before.Vlx ??
Code - Auto/Visual Lisp: [Select]
  1. Please help me, I cannot make only-Alone?>
:whistling:
Code: [Select]
:whistling:
[quote author=baitang36 link=topic=56936.msg605882#msg605882 date=1628579969]
You can find drives
(defun UsbDriveSerialNumber ( / fso dr)
  (setq fso (vlax-create-object "Scripting.FileSystemObject"))
  (vlax-for d (vlax-get fso 'Drives)
    (if
  (= (Vlax-get  d 'DriveType) 2)
      (setq dr (cons (list (vla-get-path d) (vla-get-SerialNumber d)) dr)
      )
    )
  )
  (vlax-release-object fso)
  (reverse dr)
)
(UsbDriveSerialNumber)
[/quote]
Tu nu nevoie de extragerea de informatii Hard (CPU-serial, Usb-Serial)
deoarece tu downgrade programul.Vlx, si in acest mod, cerintele soft
programului VLX creste dificulatatile de functionare a programului.VLX
si apar multe incompatibilitatii software , atunci cand Tu compilezi LSP to VLX,
LSP to DES, LSP to ELC(NanoCad)...
« Last Edit: August 10, 2021, 06:12:20 AM by d2010 »