Author Topic: Server Path...  (Read 2388 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
Server Path...
« 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 ?
Keep smile...

CADmium

  • Newt
  • Posts: 33
Re: Server Path...
« Reply #1 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:")
"Bei 99% aller Probleme ist die umfassende Beschreibung des Problems bereits mehr als die Hälfte der Lösung desselben."

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Server Path...
« Reply #2 on: January 24, 2006, 09:16:41 AM »
CAD...

First...welcome to the swamp...

second....

WOW !!...
thanks !
Keep smile...

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: Server Path...
« Reply #3 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))
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Server Path...
« Reply #4 on: January 24, 2006, 01:30:05 PM »
Gracias..signor Menzi

 8-)
Keep smile...

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: Server Path...
« Reply #5 on: January 25, 2006, 01:55:11 AM »
À votre service monsieur... :-)
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18