Skip to content

Instantly share code, notes, and snippets.

@jasp402
Last active March 5, 2019 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasp402/4809648a061b55369c6cf7e857d4a1fa to your computer and use it in GitHub Desktop.
Save jasp402/4809648a061b55369c6cf7e857d4a1fa to your computer and use it in GitHub Desktop.
AutoIt: Move files source and destination with complete path
#include <File.au3>
#include <Array.au3>
#include <WinAPIFiles.au3>
#include <FileConstants.au3>
HotKeySet("{ESC}", "Terminate")
;~ ---------------------------------
Global $listFile = "Y:\FileNameTif.txt" ;TIFF y TIFF
Global $orig = "Y:\TIF\" ; SOLO TIF
Global $dest = "Y:\_RESULT\"
Local $aArray = FileReadToArray($listFile)
Local $iLineCount = @extended
If @error Then
MsgBox($MB_SYSTEMMODAL, "", "There was an error reading the file. @error: " & @error)
Else
For $i = 0 To $iLineCount - 1
ConsoleWrite($aArray[$i]&@CRLF)
FileMove($orig&$aArray[$i], $dest&$aArray[$i], $FC_OVERWRITE + $FC_CREATEPATH)
If @error Then
ConsoleWriteError('ERROR Copy:'&@error&@CRLF)
EndIf
Next
EndIf
;~ ---------------------------------
Func Terminate()
Exit
EndFunc ;==>Terminate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment