Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get the server name where drve X is mapped.

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
mdhutchinson
346 Views, 2 Replies

Get the server name where drve X is mapped.

How can I access the system info to get what server name a network dirve is mapped with visual lisp?

2 REPLIES 2
Message 2 of 3
Gary_J_Orr
in reply to: mdhutchinson

For Windows file system information I usually use the Windows "Scripting.FileSystemObject"

 

Help can be found at Microsoft.com developer help.

 

Some basics to get you started (copied out of an old file syncronizing utility):

 

  (princ "\nStarting scripting Interface")
  (setq scrptobj (vla-getinterfaceobject (vlax-get-acad-object) "scripting.filesystemobject"))

;get a folder
    (setq sourcefoldobj (vlax-invoke-method scrptobj "getfolder" sourcefolder))
;get a drive
    (setq sourcedrv (vlax-get-property sourcefoldobj "Drive"))

    ;Check Drive types
    ;0=unknown
    ;1=removable(floppy/zip)
    ;2=fixed(hard drive)
    ;3=remote(network)
    ;4=cdrom
    ;5=ramdisk???

    (if (= 2 (vlax-get sourcedrv "DriveType"))
      (progn
	(alert "Check Drive Mappings. You're copying from a Local Hard Drive")
	(exit)
	)
      )

 

A few vlax-dump-object calls on some of the above may get you a long way.

 

Happy Lisping

-Gary

Gary J. Orr
(Your Friendly Neighborhood) CADD/BIM/VDC Applications Manager
http://www.linkedin.com/in/garyorr

aka (current and past user names):
Gary_J_Orr (GOMO Stuff 2008-Present); OrrG (Forum Studio 2005-2008); Gary J. Orr (LHB Inc 2002-2005); Orr, Gary J. (Gossen Livingston 1997-2002)
Message 3 of 3
Gary_J_Orr
in reply to: Gary_J_Orr

I posted that one kinda quick but using that "getInterfaceobject" call as an example of translating here are some additional objects that you may need (taken from a VBScript routine):

Set netObject = WScript.CreateObject("WScript.Network")
Set shlObject = WScript.CreateObject("WScript.Shell")
set fsObject = wscript.createobject("Scripting.FileSystemObject")

fsObject.DriveExists("O:")
set fsoDrive = fsObject.GetDrive("O:")
netObject.MapNetworkDrive "O:", "\\DESIGN\CAD_MGMT"

I hope that I haven't made your day any more complicated than it already was
-G
Gary J. Orr
(Your Friendly Neighborhood) CADD/BIM/VDC Applications Manager
http://www.linkedin.com/in/garyorr

aka (current and past user names):
Gary_J_Orr (GOMO Stuff 2008-Present); OrrG (Forum Studio 2005-2008); Gary J. Orr (LHB Inc 2002-2005); Orr, Gary J. (Gossen Livingston 1997-2002)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost