Chuckero Posted July 29, 2021 Share Posted July 29, 2021 Hello, I'm copying a folder from a network drive to an USB memory key, using this script: Local $sPathFrom = "G:\temp\test files from\" Local $sPathTo = "D:\temp\test files to\" Local $sRet $sRet = DirCopy($sPathFrom, $sPathTo) If (Not $sRet) Then MsgBox($MB_OK, "Copy test", "Unable to copy the folder! - $sRet: " & $sRet) Else MsgBox($MB_OK, "Copy test", "Copy OK! - $sRet: " & $sRet) EndIf Before testing, I deleted the destination folder just to be sure that there is no folder at the destination path. It works pretty well and returns 1, but, if I add the directive #RequireAdmin it doesn't work and returns 0. Is there some not documented details about DirCopy() function? Or am I missing something? Thanks in advance Link to comment Share on other sites More sharing options...
ajag Posted July 30, 2021 Share Posted July 30, 2021 (edited) I guess your Admin-Account doesn't have "G:" mapped or does not have permissions to G:\temp\test files from\ Edited July 30, 2021 by ajag further guess Rule #1: Always do a backup Rule #2: Always do a backup (backup of rule #1) Link to comment Share on other sites More sharing options...
Developers Jos Posted July 30, 2021 Developers Share Posted July 30, 2021 ... or the G: map isn't available so you could try UNC : \\servername\path\.... Chuckero 1 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...
rudi Posted August 13, 2021 Share Posted August 13, 2021 open an administrative CMD.EXE box ("Run as Administrator") Then type net use and, as already mentioned by Jos dir \\server\share\path\file.xyz ... to see, if you have access rights in the "Admin UAC context" If not, then use ... net use \\server\ipc$ /user:domain\user * ... to see, if you are able to gain access rights now. Autoit: See the Help File for DriveMap* functions. CU, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Chuckero Posted August 19, 2021 Author Share Posted August 19, 2021 Thanks @Jos, that's exactly the issue. This formatting worked: //SERVERNAME/path/ And this as well: \\SERVERNAME\path\ Problem solved. Thanks! 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