hendrikhe Posted August 10, 2017 Share Posted August 10, 2017 Hello, I am having issues copying OneDrive Folder. With the script below, it simple copies nothing. Nothing happens, no error message. Working with other "normal" folders. Is the OneDrive Folder special? DirCopy("C:\Users\Test\OneDrive\", "D:\new",1) Link to comment Share on other sites More sharing options...
Simpel Posted August 10, 2017 Share Posted August 10, 2017 Hi. Helpfile says: source dir = Path of the source directory (with no trailing backslash). e.g. "C:\Path1" Maybe you have to script: DirCopy("C:\Users\Test\OneDrive", "D:\new",1) Conrad SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. Link to comment Share on other sites More sharing options...
hendrikhe Posted August 10, 2017 Author Share Posted August 10, 2017 Thanks for reply. Tried but still same result Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 10, 2017 Moderators Share Posted August 10, 2017 Have you attempted adding #RequireAdmin at the top of your script? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
hendrikhe Posted August 10, 2017 Author Share Posted August 10, 2017 Tried that too, same result. Strange is: it does work with the subfolders (even without #RequireAdmin ) Link to comment Share on other sites More sharing options...
Simpel Posted August 10, 2017 Share Posted August 10, 2017 Is OneDrive on C: really a directory or could it be a shortcut? What is the result if you try this: ConsoleWrite(FileGetAttrib("C:\Users\Test\OneDrive") & @CRLF) SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. Link to comment Share on other sites More sharing options...
hendrikhe Posted August 10, 2017 Author Share Posted August 10, 2017 Not sure how to get the output from : ConsoleWrite(FileGetAttrib("C:\Users\Test\OneDrive") & @CRLF) But DirGetSize("C:\Users\Test\OneDrive") got me the correct size of this folder Link to comment Share on other sites More sharing options...
Simpel Posted August 10, 2017 Share Posted August 10, 2017 Just run the line and look what is written in the console window beneath. SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. Link to comment Share on other sites More sharing options...
hendrikhe Posted August 10, 2017 Author Share Posted August 10, 2017 (edited) >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Test\Desktop\move.au3" /UserParams +>13:47:59 Starting AutoIt3Wrapper v.17.224.935.0 SciTE v.3.7.3.0 Keyboard:00000416 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0407) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\Test\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\Hiss\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.2) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\Test\Desktop\move.au3 +>13:47:59 AU3Check ended.rc:0 >Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\Test\Desktop\move.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop RD +>13:47:59 AutoIt3.exe ended.rc:0 +>13:47:59 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.7716 Edited August 10, 2017 by hendrikhe Link to comment Share on other sites More sharing options...
Neutro Posted August 10, 2017 Share Posted August 10, 2017 (edited) Hello @hendrikhe, Try this: $result = DirCopy("C:\Users\Test\OneDrive", "D:\new") if $result = 1 then msgbox("","OK", "DirCopy function worked") if $result = 0 then msgbox("","error", "DirCopy function report failure") Edited August 10, 2017 by Neutro Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
hendrikhe Posted August 10, 2017 Author Share Posted August 10, 2017 $a=DirCopy("C:\Users\Test\OneDrive", "D:\move",1) MsgBox($MB_SYSTEMMODAL, "Title", $a) $a=DirGetSize("C:\Users\Test\OneDrive") MsgBox($MB_SYSTEMMODAL, "Title", $a) result DirCopy = 0 result DirGetSize = 967179211 Link to comment Share on other sites More sharing options...
Simpel Posted August 10, 2017 Share Posted August 10, 2017 What @Neutro means: ConsoleWrite(DirCopy("C:\Users\Test\OneDrive", "D:\new",1) & @CRLF) FileGetAttrib says "RD" in console output. D means directory what is correct. R means read only. My directories normally don't have the attribute read only. Maybe that's the reason? You are not allowed to copy this directory? Can you try this: FileSetAttrib("C:\Users\Test\OneDrive","-R") ; ConsoleWrite(FileGetAttrib("C:\Users\Test\OneDrive") & @CRLF) Is attribute "R" gone then? Can you now copy the directory? Conrad SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. Link to comment Share on other sites More sharing options...
Neutro Posted August 10, 2017 Share Posted August 10, 2017 (edited) 2 hours ago, hendrikhe said: $a=DirCopy("C:\Users\Test\OneDrive", "D:\move",1) MsgBox($MB_SYSTEMMODAL, "Title", $a) $a=DirGetSize("C:\Users\Test\OneDrive") MsgBox($MB_SYSTEMMODAL, "Title", $a) result DirCopy = 0 result DirGetSize = 967179211 Remove the "1" parameter at the end of DirCopy and try again PS: if everything fail you can use cmd as a workaround: DirCreate("D:\new") RunWait(@ComSpec & ' /c ' & 'copy "C:\Users\Test\OneDrive" "D:\new" /Y', "", @SW_HIDE) Edited August 10, 2017 by Neutro Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
hendrikhe Posted August 10, 2017 Author Share Posted August 10, 2017 @Neutro same result @Simpel >Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\Test\Desktop\move.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop +>14:09:59 AutoIt3.exe ended.rc:0 +>14:09:59 AutoIt3Wrapper Finished. Link to comment Share on other sites More sharing options...
Neutro Posted August 10, 2017 Share Posted August 10, 2017 Is the runwait from my last post failing as well? Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
hendrikhe Posted August 10, 2017 Author Share Posted August 10, 2017 yes Link to comment Share on other sites More sharing options...
Neutro Posted August 10, 2017 Share Posted August 10, 2017 Open cmd in windows and try "copy "C:\Users\Test\OneDrive" "D:\new" /Y See if there are any errors Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
hendrikhe Posted August 10, 2017 Author Share Posted August 10, 2017 that worked Neutro 1 Link to comment Share on other sites More sharing options...
Neutro Posted August 10, 2017 Share Posted August 10, 2017 (edited) RunWait(@ComSpec & ' /c ' & 'copy "C:\Users\Test\OneDrive" "D:\new" /Y', "", @SW_HIDE) is the exact same thing as running "copy "C:\Users\Test\OneDrive" "D:\new" /Y on Windows cmd. If it's working using Windows cmd but not with the AutoIT code, it suggests that AutoIT has a privilege (rights) problem with your script. If #RequireAdmin doesn't work, try compiling the script with it then right click on the exe and use "run as admin" PS: you can use RunWait(@ComSpec & ' /c ' & 'copy "C:\Users\Test\OneDrive" "D:\new" /Y > c:\test.txt', "", @SW_HIDE) To get the result of the copy command from autoit in c:\test.txt Edited August 10, 2017 by Neutro Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
hendrikhe Posted August 14, 2017 Author Share Posted August 14, 2017 The copy command is too *heavy* for big files. tried with "move" but no result, I also need the subfolders moved RunWait(@ComSpec & ' /c ' & 'move "C:\Users\Test\OneDrive" "D:\new" /Y > c:\test.txt', "", @SW_HIDE) 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