Sign in to follow this  
Followers 0
OSchmid14

FileFindNext and FileMove

2 posts in this topic

I am testing a very short and I would say uncomplicated script that tries to find certain files in a defined directory and then moves or copies the file to a new name.

For some reason, as long I hard code the file name(s) (from and to) it all works fine, but the moment I use variables it does not work anymore. Following the working example and the non-working example. I am lost and also new to AutoIt V3. What am I missing here? At this time I left off any loop to find additional files until I get this part working right. :)

Working

FileMove ("k:\test\po_testfile.txt","k:\test\testupload.idoc")

Exit

Not working:

$search = FileFindFirstFile("K:\test\po*.*")

$file = FileFindNextFile($search)

MsgBox(0,$search,$file) ; message to check variable content

$file1=("k:\test\testupload.idoc")

FileMove($file,$file1)

FileClose($search)

Exit

Share this post


Link to post
Share on other sites



$file = FileFindNextFile($search)

FileMove($file,$file1)

FileFindNext() returns just the file name, NOT the path!

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

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  
Followers 0