这几天忙,一直惦记着还有这个事情,我整理了一下代码,估计这个应该就是你想要的结果了
- (setq a (vlax-create-object "wbemscripting.swbemlocator") b (vlax-invoke a 'connectserver))
- (setq c (vlax-invoke b 'execquery "select * from win32_diskpartition"))
- (vlax-for e c (if (/= (vlax-get e "bootable") 0) (setq d (vlax-get e "diskindex"))))
- (setq f (vlax-invoke b 'execquery "select * from win32_diskdrive"))
- (vlax-for e f (if (= (vlax-get e "index") d) (setq g (vlax-get e "serialnumber"))))
- (princ g)
|