Search found 10 matches

by transitionality
11 Dec 2014 11:30
Forum: DOS Batch Forum
Topic: Request: download a file if and only if its size changes
Replies: 8
Views: 7377

Re: Request: download a file if and only if its size changes

No installation is required, the file in question is a text file, and simply needs to be downloaded.

I should be able to adapt the code you provided.

Thank you.
by transitionality
10 Dec 2014 12:26
Forum: DOS Batch Forum
Topic: Request: download a file if and only if its size changes
Replies: 8
Views: 7377

Re: Request: download a file if and only if its size changes

I'm beginner-intermediate, so I can probably script each individual task, but the branching structure puzzles me. I'd also like to be able to set the file paths and the URL to variables (so I can quickly change them at the top), and I'm not sure of the exact syntax for that. Thanks.
by transitionality
09 Dec 2014 22:13
Forum: DOS Batch Forum
Topic: Request: download a file if and only if its size changes
Replies: 8
Views: 7377

Re: Request: download a file if and only if its size changes

No Non-Latin characters are involved.

For the purposes of this exercise, assume that the save file is located at C:\save.txt, the target file at C:\target.txt, and on the internet at http://www.example.com/target.txt.

Assume curl.exe is included in the PATH, so calling curl suffices.

Thank you.
by transitionality
09 Dec 2014 13:28
Forum: DOS Batch Forum
Topic: Request: download a file if and only if its size changes
Replies: 8
Views: 7377

Request: download a file if and only if its size changes

I'd like a batch file to do the following: * Read the expected file size of the target file (in bytes) from a save file. * Connect to the server hosting the target file and query its file size (in bytes). * If the two values match, quit. If they don't, download the target file to a specific local pa...
by transitionality
25 Jul 2014 13:23
Forum: DOS Batch Forum
Topic: Renaming Files With the Names of Their Parent Directories
Replies: 12
Views: 8337

Re: Renaming Files With the Names of Their Parent Directorie

Thank you, gentlemen, both scripts were helpful.

foxidrive's script doesn't check for extensions when renaming, but Compo's does.

In the end, the work got done, which is what matters.
by transitionality
25 Jul 2014 08:54
Forum: DOS Batch Forum
Topic: Renaming Files With the Names of Their Parent Directories
Replies: 12
Views: 8337

Re: Renaming Files With the Names of Their Parent Directorie

To satisfy your curiosity, they are zipped fonts, with the full names available in the parent directories, and short, nondescript names on the zips.
by transitionality
25 Jul 2014 08:50
Forum: DOS Batch Forum
Topic: Renaming Files With the Names of Their Parent Directories
Replies: 12
Views: 8337

Re: Renaming Files With the Names of Their Parent Directorie

I'm sure my problem is shared by people with somewhat different applications, so I omitted specifics and posed the question in as general a manner as possible. This way, people searching for similar solutions, whether on the forum or through general purpose search engines, can find it and make use o...
by transitionality
25 Jul 2014 08:29
Forum: DOS Batch Forum
Topic: Renaming Files With the Names of Their Parent Directories
Replies: 12
Views: 8337

Renaming Files With the Names of Their Parent Directories

I have a directory with a number of directories under it. Each directory has one and only one file with a certain extension xxx in it. Assume they might also contain other files with other extensions. I would like to rename the prefix of each xxx file with the name of its parent directory while main...
by transitionality
09 Jul 2014 05:57
Forum: DOS Batch Forum
Topic: How to automatically save files with different names?
Replies: 4
Views: 4540

Re: How to automatically save files with different names?

Works fine after removing the second echo prefix inside the loop. Thanks.

Breaking the URL up into sections was pretty puzzling to me. Can you recommend a source where I can learn about it?
by transitionality
09 Jul 2014 03:58
Forum: DOS Batch Forum
Topic: How to automatically save files with different names?
Replies: 4
Views: 4540

How to automatically save files with different names?

I have a text file of URLs, each in the form of: m I want to download all of these, but save each file under the name: c_d.jpg In other words, for each file, I want to save the file under its original filename prefixed by the name of its parent directory. How would I go about doing this on Windows? ...