hendrikhe Posted April 21, 2017 Posted April 21, 2017 Hello AutoIt community, I am adding a network folder with: DriveMapAdd("", "\\Server01\SharedFolder","", "corp\test", "Test123") After sending a file to this network folder with FileMove I would like to remove the access to this network folder (password protected): $a = DriveMapDel("\\Server01\SharedFolder") But after DriveMapDel if I navigate manually to \\Server01\SharedFolder , I am still able to access this folder, only a loggoff helps to quit access to this shared folder. I would like to deny the access to this folder after DriveMapDel, what I am doing wrong? #include <MsgBoxConstants.au3> #include <File.au3> DriveMapAdd("", "\\Server01\SharedFolder","", "corp\test", "Test123") FileMove(@MyDocumentsDir & '\test\' & "test.txt","\\Server01\SharedFolder" & @UserName& "." & @ComputerName&".txt",$FC_OVERWRITE) $a = DriveMapDel("\\Server01\SharedFolder") MsgBox($MB_SYSTEMMODAL, "", "DriveDel: " & $a) ; its showing 1 "success" Best regards Hendrik
jguinch Posted April 21, 2017 Posted April 21, 2017 Sometimes, you have to force the drive to deconnect. You can try this : _WinNet_CancelConnection("\\Server01\SharedFolder", True) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
hendrikhe Posted April 21, 2017 Author Posted April 21, 2017 I never saw something like this , I even added: _WinNet_CancelConnection("\\Server01\SharedFolder", True) _WinNet_CancelConnection2("\\Server01\SharedFolder", True, True) $a = DriveMapDel("\\Server01\SharedFolder") Still not working, the connection is too "strong", only logging off helps: DriveMapAdd("", "\\Server01\SharedFolder","", "corp\test", "Test123") FileMove(@MyDocumentsDir & '\test\' & "test.txt","\\Server01\SharedFolder" & @UserName& "." & @ComputerName&".txt",$FC_OVERWRITE) $a = DriveMapDel("\\Server01\SharedFolder") _WinNet_CancelConnection("\\Server01\SharedFolder", True) _WinNet_CancelConnection2("\\Server01\SharedFolder", True, True) $a = DriveMapDel("\\Server01\SharedFolder") MsgBox($MB_SYSTEMMODAL, "", "DriveDel: " & $a) ; its showing 1 "success"
jguinch Posted April 21, 2017 Posted April 21, 2017 Sometimes with Windows 7, I have a similar problem, when I delete a network connection (using net use \\server\share /delete with success), but it's still accessible... In this case, wait about 30 secconds after removing the network connection Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
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