TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on January 24, 2006, 08:02:36 AM
-
Hi all..
I'm trying to get the server path name...
eg:
the drive Y:\ in fact is..
\\servrer1\login\data\
how can i get this in lisp ?
-
(defun FOLDER-GET-SHAREDPATH (FOLDERNAME / FSO RESULT)
(if(setq FSO (vlax-create-object "Scripting.FilesystemObject"))
(progn
(if(and(vlax-method-applicable-p FSO 'GETFOLDER)
(not(vl-catch-all-error-p
(setq RESULT(vl-catch-all-apply
'vlax-invoke-method
(list FSO
'GETFOLDER
FOLDERNAME
)
)
)
)
)
)
(setq RESULT(strcat
(vlax-get-property(vlax-get-property RESULT 'drive)'Sharename)
(substr (vlax-get-property RESULT 'Path)3)
)
)
)
(vlax-release-object FSO)
)
)
RESULT
)
for you (FOLDER-GET-SHAREDPATH "Y:")
-
CAD...
First...welcome to the swamp...
second....
WOW !!...
thanks !
-
Visit my homepage -> Free Stuff and search for 'VxListNetworkDrives'. This function returns a list of all mapped network drives with UNC path's:
'(("X:" . "\\\\Server\\Xpath")...)
You can simple access the result with:
(cdr (assoc "Drive:" ResultList))
-
Gracias..signor Menzi
8-)
-
À votre service monsieur... :-)