Announcement

Collapse
No announcement yet.

Finding servername for mapped drive?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Finding servername for mapped drive?

    I have a mapped drive that I need to be able to find the servername for - meaning if x: is mapped to \\myserver\test, I need the script to find the "myserver" part of the mapping.

    Is there a built in statment that can handle this task?

    Thank you.

  • #2
    Have a look at NetUseGetInfo or WNetGetConnection, here is a PB example.

    Code:
     
     
    #INCLUDE "win32api.inc"
     
    FUNCTION PBMAIN( )
     LOCAL StrPath AS STRING
     strPath = SPACE$( %MAX_PATH )
     WNETGETCONNECTION "P:", BYVAL STRPTR( strPath ), LEN( strPath )
     MSGBOX strPath
    END FUNCTION
    <b>George W. Bleck</b>
    <img src='http://www.blecktech.com/myemail.gif'>

    Comment


    • #3
      Another possibility, take a look at Pierre Belisle's posting here: http://www.powerbasic.com/support/pb...t=21210&page=2
      Adam Drake
      PowerBASIC

      Comment


      • #4
        Awesome - works perfect.

        Comment

        Working...
        X