 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
guestguest Guest
|
Posted: Tue Dec 01, 2009 11:05 pm Post subject: question about filemove |
|
|
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
|
Posted: Tue Dec 01, 2009 11:18 pm Post subject: |
|
|
?
| Code: | name=year.txt
filemove, month.txt, %name% |
|
|
| Back to top |
|
 |
guestguest Guest
|
Posted: Wed Dec 02, 2009 3:19 am Post subject: |
|
|
my bad.
I put the comma, but it still does not work |
|
| Back to top |
|
 |
hd0202
Joined: 13 Aug 2006 Posts: 265 Location: Germany
|
Posted: Wed Dec 02, 2009 5:32 am Post subject: |
|
|
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 |
|
 |
pearlst
Joined: 25 Feb 2010 Posts: 8 Location: USA
|
Posted: Tue Mar 09, 2010 4:41 pm Post subject: filemove and rename |
|
|
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 |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
Posted: Tue Mar 09, 2010 4:56 pm Post subject: |
|
|
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 |
|
 |
pearlst
Joined: 25 Feb 2010 Posts: 8 Location: USA
|
Posted: Tue Mar 09, 2010 5:23 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|