Jump to content
Sign in to follow this  

filemove not working

Recommended Posts



I am having trouble with getting Filemove to work. I want to upload each file in a folder, and then move it to a different folder. The rest of the code works, but the Filemove part simply doesn't do anything:

#include <IE.au3>
#Include <File.au3>
Dim $array
$oIE = _IEAttach ("Website Title", "WindowTitle")

$array = _FileListToArray("C:\Folder1\")
For $file in $array
    If StringIsDigit($file) = 0 Then
    _IELinkClickByText($oIE, "Upload" )
_IELoadWait ($oIE)

$oSubmit = _IEGetObjByName ($oIE, "Input File")
MouseMove(_IEPropertyGet($oSubmit, "screenx") + _IEPropertyGet($oSubmit, "width") - 10, _
          _IEPropertyGet($oSubmit, "screeny") + _IEPropertyGet($oSubmit, "height")/2)
WinWait("Choose File to Upload")
$hChoose = WinGetHandle("Choose File to Upload")
ControlSetText($hChoose, "", "Edit1", $file)
ControlClick($hChoose, "", "Button1")
$ok = _IEGetObjByName ($oIE, "OK")
_IEAction($ok, "click")
_IELoadWait ($oIE)
fileMove($file, StringReplace($file, "Folder1", "Folder2"), 8)


Thank you!

Share this post

Link to post
Share on other sites

The results from _FileListToArray() are only file names without the directory path. You probably need the full path to the file for FileMove().


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.