Darien Posted May 21, 2018 Share Posted May 21, 2018 (edited) Hello, The command below always returns -1, but I can usually map this folder to Windows as \\computerX\folderX. _Net_Share_ShareCheck ( "computerX" , "folderX" ) What could it be? Edited May 21, 2018 by Darien Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted May 21, 2018 Moderators Share Posted May 21, 2018 Try _Net_Share_ShareEnum and see what you get back. Link to comment Share on other sites More sharing options...
Darien Posted May 21, 2018 Author Share Posted May 21, 2018 The _Net_Share_ShareEnum shows the shared folder. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted May 22, 2018 Moderators Share Posted May 22, 2018 _Net_Share_ShareCheck is looking for a local path instead of a share name. Try this: #include <MsgBoxConstants.au3> #include <NetShare.au3> If CheckShareByName(@ComputerName, "AutoIt Share") = -1 Then MsgBox(0, "", "Share does not exist") Else MsgBox(0, "", "Share exists!") EndIf Func CheckShareByName($sServer, $sShareName) Local $aReturn = _Net_Share_ShareGetInfo($sServer, $sShareName) If @error Then Return SetError(@error, 0, -1) Return _Net_Share_ShareCheck($sServer, $aReturn[6]) EndFunc Link to comment Share on other sites More sharing options...
Darien Posted May 22, 2018 Author Share Posted May 22, 2018 Thank you. Link to comment Share on other sites More sharing options...
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