grunewald6 Posted September 10, 2009 Posted September 10, 2009 Does anyone know a way to determine what drive letter a remote share is located on? I want to be able to look at a share and determine how much space is left on the drive that that share is located on but will not always know the drive letter beforehand to use the DriveSpaceFree command. Thanks in advance for any suggestions.
Nutster Posted September 10, 2009 Posted September 10, 2009 Look at DriveGetDrive and DriveGetType in the documentation for more ideas. David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd...
rudi Posted September 15, 2009 Posted September 15, 2009 Does anyone know a way to determine what drive letter a remote share is located on? What you need to look at is the function DriveMapGet() There you go: $Share = "\\servername\sharename" For $i = 65 To 90 ; ASC("A")=65, ASC("Z")=90 $next = Chr($i) & ":" If DriveGetType($next) = "Network" Then If DriveMapGet($next) = $Share Then MsgBox(0, "Map Searcher", $Share & " is mapped to drive letter " & $next & ": ...") Exit EndIf EndIf Next MsgBox(0, "Map Searcher", "Currently there is no drive letter mapped to " & $Share) Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
ZULUNINER Posted September 21, 2012 Posted September 21, 2012 Thanks Rudi, I was able to modify your code to fit my purpose. Posting here to help out others. $ShareOld = "SERVEROldShare" $ShareNew = "SERVERNewShare" For $i = 65 To 90 ; ASC("A")=65, ASC("Z")=90 $next = Chr($i) & ":" If DriveGetType($next) = "Network" Then If DriveMapGet($next) = $ShareOld Then DriveMapDel($next) Sleep(1000) DriveMapAdd($next, $ShareNew, 1) Exit EndIf EndIf Next
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now