AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

question about filemove

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
guestguest
Guest





PostPosted: Tue Dec 01, 2009 11:05 pm    Post subject: question about filemove Reply with quote

There are 2 scripts.
The first one works well, but the second one does not work.

Is the question because of variable?(name)

Thanks so much

Script1:
filemove, month.txt, year.txt


script2:
name=year.txt
filemove month.txt, %name%
Back to top
Guest






PostPosted: Tue Dec 01, 2009 11:18 pm    Post subject: Reply with quote

?
Code:
name=year.txt
filemove, month.txt, %name%
Back to top
guestguest
Guest





PostPosted: Wed Dec 02, 2009 3:19 am    Post subject: Reply with quote

my bad.
I put the comma, but it still does not work
Back to top
hd0202



Joined: 13 Aug 2006
Posts: 265
Location: Germany

PostPosted: Wed Dec 02, 2009 5:32 am    Post subject: Reply with quote

No problem with script2.

Do you still have a file "month.txt" when you run script2? Isn't it already renamed by script1?

Hubert
Back to top
View user's profile Send private message
pearlst



Joined: 25 Feb 2010
Posts: 8
Location: USA

PostPosted: Tue Mar 09, 2010 4:41 pm    Post subject: filemove and rename Reply with quote

Ok, this is branching a little off of this topic.

The file is:
C:\TRBALDUE.TXT

I want to move it to the G drive:
G:\PaymentProcessing\lockbox\incoming

And rename it as:
TRBALDUE_030910.TXT

I need to include this somewhere so that it will have the current date:
FormatTime, CurrentDateTime,, MMddyy
SendInput %CurrentDateTime%

Any help would be appreciated, I know it is simple, but I just can't seem to get it. Thanks!
Back to top
View user's profile Send private message
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Tue Mar 09, 2010 4:56 pm    Post subject: Reply with quote

you can use splitpath to get the filename and then construct the target filename like so:
Code:
from=TRBALDUE.TXT
SplitPath, from, , , , OutNameNoExt
FormatTime, CurrentDateTime,, MMddyy
to:="\" OutNameNoExt "_" CurrentDateTime ".txt"
MsgBox % "G:\PaymentProcessing\lockbox\incoming" to

_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
pearlst



Joined: 25 Feb 2010
Posts: 8
Location: USA

PostPosted: Tue Mar 09, 2010 5:23 pm    Post subject: Reply with quote

I don't understand the msgbox, it doesn't actually move the file to the G drive.

What I have done so far that works is this:
Code:
FileMove, C:\TRBALDUE.TXT, G:\TRBALDUE_030910.TXT


What's not working is the automatic date change and for some reason it won't move the folder within other folders?? unsure as to why?

This code doesn't work:
Code:
FileMove, C:\TRBALDUE.TXT, G:\Payment Processing\Lockbox\Incoming\TRBALDUE_030910.TXT


I was trying to do this, but unsure what I'm doing:
Code:
FileMoveDir, C:\TRBALDUE.TXT, G:\Payment Processing\Lockbox\Incoming (G:\TRBALDUE_030910.TXT), R
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group