I can manually create and modify documents in both the source and destination folders, and the file I'm trying to move is not read-only. Oddly, while FileCopy doesn't work either, my script successfully uses FileDelete and FileAppend on a text file in the source folder for storing variables between runs.
The following is not the main script, but that is the source and destination I'm trying to move between. This does NOT work on my system, and A_LastError is set to 3 - which is Windows for ERROR_PATH_NOT_FOUND. However, the FileDelete at the end works exactly as expected.
Code: Select all
#SingleInstance Force
#Persistent
#NoEnv
Source := "C:\Users\khigby\Documents\Purgatory\TEMP-190416-001.pdf"
DestA := "R:\Receipts\Integricoat\42727\28242.pdf"
DestB := "C:\Users\khigby\Documents\Receipt Archive\TEMP-190416-001.pdf"
FileSetAttrib,-R,%Source% ;Make sure the file is writable.
Try
FileMove, %Source%, %DestA%
Catch {
Try
FileMove, %Source%, %DestB%
Catch
MsgBox All is lost. Your dreams are dead. Abandon hope.
}
FileDelete, %Source%
Return