Sbeve Posted September 3, 2021 Share Posted September 3, 2021 Hello there everyone, i have a very odd issue. I am in the process of making a backup program, that can back up files from any PC on the network, or my own. It works, it does its job very well. There is one issue though: It cannot copy word documents. I am currently using robocopy, before i used FileCopy and DirCopy. None of those work. If i open CMD on my PC and manually write in "robocopy (path source) (path destination) /e", then it copies all files, no problem, including word documents (.docx). But, if i use FileCopy, DirCopy, or even Run(@comspec & " /c " & "robocopy etc...) inside AutoIt, it copies everything: the files, folders, excel files, shortcuts, photos, everything that you want it to copy. It just leaves out the .docx files. I honestly have reached the limit of my patience when it comes to this, and online i haven't found any clues as to why its doing this. Just to clarify: I am running with admin rights, the "_FileListToArray" function does list those files. Very strange. Another thing that i noticed today: _FileCreate is incapable of creating Word documents. I'm very intrigued as to why this is happening, maybe an issue with my AutoIt installation on my machine? My question is: Has anybody noticed something similar to this? and also: Does anybody know a solution to this issue? Thank you everybody for your time. Link to comment Share on other sites More sharing options...
Nine Posted September 3, 2021 Share Posted September 3, 2021 Are you able to copy .docx files from your own computer ? Can you make a replicable snippet of your code that is not working ? Can you provide a uncopyable .docx file ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Danp2 Posted September 3, 2021 Share Posted September 3, 2021 That does sound odd. Are you running any type of Antivirus software? If so, I wonder if it might be affecting this. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Sbeve Posted September 3, 2021 Author Share Posted September 3, 2021 Just now, Nine said: Are you able to copy .docx files from your own computer ? Can you make a replicable snippet of your code that is not working ? Can you provide a uncopyable .docx file ? Hi, thanks for replying! I am able to copy them, no problem if i manually right click and copy. Also, if i use CMD and manually type it in (robocopy), then it also copies everything correctly. Just inside autoit it doesn't copy .docx files. Link to comment Share on other sites More sharing options...
Sbeve Posted September 3, 2021 Author Share Posted September 3, 2021 2 minutes ago, Danp2 said: That does sound odd. Are you running any type of Antivirus software? If so, I wonder if it might be affecting this. I am running Kaspersky antivirus, i haven't thought about that possibility yet. Maybe i should look into that more. To me it's just odd that everything can be copied: excel, txt, exe, png, it doesn't matter. Those it can copy beautifully. Just .docx files fail to copy. Very frustrating and confusing. Link to comment Share on other sites More sharing options...
Nine Posted September 3, 2021 Share Posted September 3, 2021 I mean from a script, can you copy docx files from your own computer ? If I am understanding you correctly, the answer is No ? Please provide the script and file as I have previously asked you to... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Sbeve Posted September 3, 2021 Author Share Posted September 3, 2021 24 minutes ago, Nine said: I mean from a script, can you copy docx files from your own computer ? If I am understanding you correctly, the answer is No ? Please provide the script and file as I have previously asked you to... Ok, here we go: There is an "Example.au3" file, it is simplified code from my program. Both this code and my program do the same thing: copy all the files from the source folder, except the .docx files. Maybe you guys could try it out on your machines and see? And with regards to the word document, it doesn't matter. Any word document is un-copyable for my autoit scripts, but i still provided one below. Thanks for your time and patience so far. Example.au3 Test.docx Link to comment Share on other sites More sharing options...
Sbeve Posted September 3, 2021 Author Share Posted September 3, 2021 (This is the same code as in the file, in case you just want to copy it from here.) Spoiler expandcollapse popup#RequireAdmin #include <GUIConstants.au3> #include <File.au3> Global $Temp, $Files Local $hGUI = GUICreate("Copy Test", 300, 200) Local $source = GUICtrlCreateInput("Source path", 10, 20, 200, 20) Local $sourceBtn = GUICtrlCreateButton("Browse", 220, 20, 50, 20) Local $destination = GUICtrlCreateInput("Destination path", 10, 60, 200, 20) Local $destinationBtn = GUICtrlCreateButton("Browse", 220, 60, 50, 20) Local $startBtn = GUICtrlCreateButton("Start", 125, 100, 50, 20) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $sourceBtn FolderChoose($source) Case $destinationBtn FolderChoose($destination) Case $startBtn Start() EndSwitch WEnd Func FolderChoose($output) $Temp = FileSelectFolder("Choose folder", "") GUICtrlSetData($output, $Temp) EndFunc Func Start() $Files = _FileListToArray(GUICtrlRead($source)) _ArrayDisplay($Files) $path1 = GUICtrlRead($source) $path2 = GUICtrlRead($destination) For $i = 1 To $Files[0] FileCopy($path1 & "\" & $Files[$i], $path2, 1) MsgBox(0, $i, "File being copied: " & $Files[$i]) Next ;~ DirCopy(GUICtrlRead($source), GUICtrlRead($destination), 1) ;~ If @error Then ;~ MsgBox(16, "Error", "Error: something went wrong") ;~ Else ;~ MsgBox(64, "Complete", "Folder was copied succesfully.", 0, $hGUI) ;~ EndIf EndFunc Link to comment Share on other sites More sharing options...
ajag Posted September 3, 2021 Share Posted September 3, 2021 Copies Test.docx without any problems. First: Test the return value of FileCopy() to see if any error occurs. 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...
Sbeve Posted September 3, 2021 Author Share Posted September 3, 2021 1 minute ago, ajag said: Copies Test.docx without any problems. First: Test the return value of FileCopy() to see if any error occurs. So it copies it no problem for you? It seems to be an issue with my PC or, better said, my autoit installation maybe? Return value of fileCopy is "0", so failed (on that .docx file). Otherwise, every other file it's "1", so success. Link to comment Share on other sites More sharing options...
Solution Danp2 Posted September 3, 2021 Solution Share Posted September 3, 2021 Temporarily disable your Kaspersky AV and then try again. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Sbeve Posted September 3, 2021 Author Share Posted September 3, 2021 1 hour ago, Danp2 said: Temporarily disable your Kaspersky AV and then try again. I just tried this, and i can confirm: Kaspersky was blocking me from copying word documents. I went through some AV logs and found that Kaspersky had put my scripts into a restricted group. This prevented the scripts from copying .docx files, every other file that i found it was able to copy. Thanks so much for the help everyone, and especially you @Danp2!! Link to comment Share on other sites More sharing options...
Musashi Posted September 3, 2021 Share Posted September 3, 2021 11 minutes ago, Sbeve said: I went through some AV logs and found that Kaspersky had put my scripts into a restricted group. It is without a doubt a good advice from @Danp2 to temporarily disable the antivirus software. However, now that the problem has been isolated, I think it would make sense to look for a permanent solution. Does the problem also occur when you run the script inside the SciTE editor or only when you use the compiled .exe? Alternatively, you could set an exception rule for the directory where your scripts are located. "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
Sbeve Posted September 3, 2021 Author Share Posted September 3, 2021 2 hours ago, Musashi said: It is without a doubt a good advice from @Danp2 to temporarily disable the antivirus software. However, now that the problem has been isolated, I think it would make sense to look for a permanent solution. Does the problem also occur when you run the script inside the SciTE editor or only when you use the compiled .exe? Alternatively, you could set an exception rule for the directory where your scripts are located. I went with the option of making an exception rule for the folder where i store my scripts, that seemed to work the best for me. 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