samedi 29 novembre 2014

How to copy a file correctly with AutoIt?


Vote count:

0




I am trying to simply copy a file to my local appdata directory but unsuccessfully:



If Not FileExists($dir & "\tessdata\eng.traineddata") Then ConsoleWrite("FILE NOT FOUND") ;file is found
ConsoleWrite(FileGetAttrib ($dir & "\tessdata\eng.traineddata") & @CRLF) ;returns A, for archive
If Not FileExists(@LocalAppDataDir & "\Tesseract-OCR\tessdata\") Then ConsoleWrite("DIR NOT FOUND") ;directory is found
ConsoleWrite(FileGetAttrib (@LocalAppDataDir & "\Tesseract-OCR\tessdata\") & @CRLF) ; returns D, for directory

If Not FileCopy($dir & "tessdata\eng.traineddata", @LocalAppDataDir & "\Tesseract-OCR\tessdata\eng.traineddata", $FC_OVERWRITE + $FC_CREATEPATH) Then
ConsoleWrite("FILE COULD NOT BE CREATED" & @CRLF)
EndIf


The file is never copied but the directory structure is created successfully. I am not sure if there is something missing in my code but I am not seeing it.


I have tried using the directive #RequireAdmin to get UAC but it's not working anyway.



asked 1 min ago

shuji

392






How to copy a file correctly with AutoIt?

Aucun commentaire:

Enregistrer un commentaire