youtuber Posted November 21, 2018 Share Posted November 21, 2018 (edited) How to share a folder as in the picture or remove it from the share? Spoiler And I also want to check permission = Full Control,Change,Read #RequireAdmin #include <NetShare.au3> Local $sShareFolderNameAndDir = @DesktopDir & "\AutoIt Share Folder" Local $sShareName = "AutoIt Share Folder" $aInfo = _Net_Share_ShareGetInfo(@ComputerName, $sShareName) $PermissionSharedInfo = _Net_Share_PermStr($aInfo[3]) If _Net_Share_ShareCheck(@ComputerName, $sShareName) = -1 Then ConsoleWrite("Not shared " & $sShareFolderNameAndDir & @CRLF) _Net_Share_ShareAdd(@ComputerName, $sShareName, 0, $sShareFolderNameAndDir, "Share Comment Folder") ConsoleWrite("Permission shared " & $PermissionSharedInfo & " " & $sShareFolderNameAndDir & @CRLF) Else _Net_Share_ShareDel(@ComputerName, $sShareName) ConsoleWrite("Removed from sharing " & $sShareFolderNameAndDir & @CRLF) ConsoleWrite("Permission shared " & $PermissionSharedInfo & " " & $sShareFolderNameAndDir & @CRLF) EndIf Edited November 21, 2018 by youtuber Link to comment Share on other sites More sharing options...
Developers Jos Posted November 21, 2018 Developers Share Posted November 21, 2018 You are around long enough to know you need to check for success/errors of performed functions, so start with adding error checking like is done in the example for _Net_Share_ShareGetInfo(), Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
youtuber Posted November 21, 2018 Author Share Posted November 21, 2018 @Jos OK I fixed the error, but I could not find the folder to grant all permissions and remove all permissions in the help file Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted November 21, 2018 Share Posted November 21, 2018 @youtuber Using net commands Using cacls.exe Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
youtuber Posted November 21, 2018 Author Share Posted November 21, 2018 Is there a solution other than RunWait(@ComSpec Link to comment Share on other sites More sharing options...
Developers Jos Posted November 21, 2018 Developers Share Posted November 21, 2018 1 hour ago, youtuber said: Is there a solution other than RunWait(@ComSpec Because? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
youtuber Posted November 22, 2018 Author Share Posted November 22, 2018 Because : No RunWait(@ComSpec in NetShare.au3 Link to comment Share on other sites More sharing options...
Developers Jos Posted November 22, 2018 Developers Share Posted November 22, 2018 I am sorry but really don't understand either the question not the answer. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
caramen Posted November 22, 2018 Share Posted November 22, 2018 Maybe you can find your happyness in this thread ? My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
youtuber Posted November 22, 2018 Author Share Posted November 22, 2018 (edited) I found the solution, but what is the NetShare.au3 equivalent? #RequireAdmin #include <process.au3> Local $sShareFolderName = "AutoIt Share Folder" Local $sSharedDir = @DesktopDir & "\" & $sShareFolderName _RunDos("net share " & $sShareFolderName & "=" & $sSharedDir & " /GRANT:Everyone,FULL") ;share delete _RunDos("net share " & $sShareFolderName & " /DELETE") ;or _Net_Share_ShareDel(@ComputerName, $sShareFolderName) Edited November 22, 2018 by youtuber 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