Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I wrote a batch file to retrieve data from a FTP server. Basically, it formats a temporary file which the batch then filters through checking to see if files already exist in a specific location before downloading or not. I've checked the %tmpfile%.updates file and it does contain valid filenames and it's hard to believe that after over a week there are no updates available on the site. So at this point, I'm thinking it's a fault in my coding. Can anyone help me figure it out? Thanks.
----
For /F "tokens=4" %%n in ('Type %tmpfile%.updates') Do If Not Exist %destination%\%%n (Goto GetFiles) Else Goto Clean

What does the file %tmpfile%.updates contain?
Also, what is %destination%?Try this:
@echo off
For /F "tokens=4" %%n in ('Type %tmpfile%.updates') Do (
If Not Exist %destination%\%%n (
Goto GetFiles
) Else (
Goto Clean
)
)One way to tell if your script contains syntax error's is by running it from the command prompt with echo turned on. To do this, change this line @echo off to ::@echo off, then run it from a command prompt.
"Computer security." — Oxymoron

I found out what the problem is. My original code's actualy fine. It turns out the code I wrote in order to sort the latest files is incorrect. It's sorting it alphabetically, so updates from September are showing up, so it's pulling updates from then. Another thing to rack my brain. But, when you love coding, there's nothing to worry about. Thanks for your help.

![]() |
Batch file Renaming Help
|
survey to csv
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |