Check If Network Share Exists
Posted: 04 Oct 2011 18:37
Hello. I am trying to figure out if a network share exists through CMD. I had a few ideas of how to do this, but all seem to fail. First I tried but this does not work. Then I tried connecting to just the computer (no share name) using NET USE and then changing the directory to the share. This also did not work since I need to specify a share name within the NET USE command to connect to that computer. The reason I don't want to use is because it will prompt me for a username and password regardless of what is specified for the share, which is what I want to avoid.
Thanks for any help!
Code: Select all
C:\>IF EXIST \\[computername]\[share[$]] ECHO Exists
Code: Select all
C:\>NET USE * \\[computername]
C:\>CD [share]
Code: Select all
C:\>NET USE * \\[computername]\[share[$]]
Thanks for any help!