Jump to content

Recommended Posts

Posted

I need to check if a network share is mapped or not. The idea I got is to run a command "net use" and then parse the resulting text to find out if my network share is mapped or not. For example, here is a result for net use command:

Quote

 

Status       Lokal     Remote                    Netzwerk

-------------------------------------------------------------------------------
             F:        \\192.168.100.23\share1 Microsoft Windows Network
             G:        \\192.168.100.23\share2 Microsoft Windows Network

 

I can search for a string "\\192.168.100.23\share1" to find if the share is already mapped or not.

I need this method for searching because, I do not know in advance which Drive Letter is used for the network share. Also it is possible that the network share is mapped without a drive letter.

Can anybody help, how I can run "net use" command and get the result in a text buffer so that I can parse it? I do not want to create a temporary text file (like net use >> c:\temp.txt) and then parse the text file.


A different question but related. Is there an easy method in Autoit to get the drive letter for a network share which has been mapped?

Thanks!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...