TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on January 24, 2006, 08:02:36 AM

Title: Server Path...
Post 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 ?
Title: Re: Server Path...
Post by: CADmium on January 24, 2006, 08:37:55 AM
(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:")
Title: Re: Server Path...
Post by: Andrea on January 24, 2006, 09:16:41 AM
CAD...

First...welcome to the swamp...

second....

WOW !!...
thanks !
Title: Re: Server Path...
Post by: Jürg Menzi on January 24, 2006, 09:57:26 AM
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))
Title: Re: Server Path...
Post by: Andrea on January 24, 2006, 01:30:05 PM
Gracias..signor Menzi

 8-)
Title: Re: Server Path...
Post by: Jürg Menzi on January 25, 2006, 01:55:11 AM
À votre service monsieur... :-)