error line 14

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
timle
Pro Scripter
Posts: 96
Joined: Tue Apr 20, 2004 5:53 am

error line 14

Post by timle » Thu Apr 09, 2009 11:28 pm

an error popup when I run this script on line 14: "Line: 14 File specified in IfFileChangedSince is not valid" , if I click OK then it works the way it supposed to and the error popped up again for the next file
would someone help me with this

thanks

GetFileList>%dir1%\*.pdf,file_list,;
Separate>file_list,;,oldname
//Loop through folder list
Label>checkforfile
Let>k=0
Repeat>k
Let>k=k+1
Let>orgfile=oldname_%k%
//If>OLDNAME_COUNT=0,END
IfFileChanged>%orgfile%,>5,remove
until>k,oldname_count

Label>remove
DeleteFile>%orgfile%
WaitReady>1
goto>checkforfile
Label>END

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Apr 10, 2009 1:49 am

Single step through the lines and look at the values in the Watch List

Are you getting any files found?
What is the value of oldname_count?

Have you set the value of %dir1% earlier in the script in GetFileList> ?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

timle
Pro Scripter
Posts: 96
Joined: Tue Apr 20, 2004 5:53 am

double check

Post by timle » Fri Apr 10, 2009 2:50 am

when the error popped up, I click "ok" and the script delete one file and if I keep clicking OK, then eventually all the file in the directory got deleted as it supposed to.
Is there an other command in mscheduler to delete file older than "certain" date instead of that command?

And how come under my name there's a title "Pro scripter" :roll: I am not a programer by any definition :lol:

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Apr 10, 2009 11:04 am

Another way is to get the file date with the FileDate command and then compare that date with today's date. Best way to do that is with VBScript's DateDiff command which you can use to determine how many days are between the two dates.

The "Pro Scripter" label is just based on the number of posts. Just a bit of fun :-)
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts