Downloading archives and relative paths

Discuss and share scripts and script files...
Post Reply
tomuser
Posts: 135
Joined: 04 Dec 2009 18:52

Downloading archives and relative paths

Post by tomuser »

I'm trying to make a script/button which could download new file updates from different webistes and one request is also to extract archives to different locations. But I faced with several problems.

1) I'm using such command:
download "http://www.website.com/downloads/stuff.exe", "..\..\downloads\stuff (<date yyyy-mm-dd>).exe"
download "http://www.newsite.com/stuff.rar", "..\..\otherdownloads\stuff (<date yyyy-mm-dd>).rar"

If running this command it gives me kind of pop-up menu which forces me choose which one I want download (command selection). How can I set it such way that it would automatically run both commands?

2) Other problem what I discovered is that it is dependent on which drive and folder I am currently. In some situations it says folder not found becuase it will double some folders in pathways (ie. \downloads\downloads\). How can I use relative paths starting from XYplorer folder no matter which hard drive and folder is currently selected?

3) When first two are fixed then I need additional command for some archive files which would download file, extracts its content to specified folder and then deletes archive file itself.

Thanks in advance

admin
Site Admin
Posts: 66249
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Downloading archives and relative paths

Post by admin »

1) Indent all non first lines:

Code: Select all

download "http://www.website.com/downloads/stuff.exe", "..\..\downloads\stuff (<date yyyy-mm-dd>).exe"
  download "http://www.newsite.com/stuff.rar", "..\..\otherdownloads\stuff (<date yyyy-mm-dd>).rar"
2) Use <xypath> to refer to the (unslashed) path of XYplorer.exe

tomuser
Posts: 135
Joined: 04 Dec 2009 18:52

Re: Downloading archives and relative paths

Post by tomuser »

download "http://www.website.com/downloads/stuff.exe", "<xypath>..\..\downloads\stuff (<date yyyy-mm-dd>).exe"
download "http://www.newsite.com/stuff.rar", "<xypath>..\..\otherdownloads\stuff (<date yyyy-mm-dd>).rar"

Adding <xypath> to target folder path works nomatter wherever I am (though path looks very long and ugly (first Xyplorer path and then relative path also in the end) :P).

But when adding space before second download command line then it cannot find path. It creates something like this D:\F:\ when I am in other disk drive. And when in same disk then it it wants to dowload to path with doubleing this part in target path in which folder I currently am :/.

admin
Site Admin
Posts: 66249
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Downloading archives and relative paths

Post by admin »

Statements have to be terminated with ;

Code: Select all

download "http://www.website.com/downloads/stuff.exe", "..\..\downloads\stuff (<date yyyy-mm-dd>).exe";
  download "http://www.newsite.com/stuff.rar", "..\..\otherdownloads\stuff (<date yyyy-mm-dd>).rar";

tomuser
Posts: 135
Joined: 04 Dec 2009 18:52

Re: Downloading archives and relative paths

Post by tomuser »

(F)excellent

Now diving into third part of request.

Edit: I discovered something bad again with multidownload. If there is download commad to file which doesn't exist (some are using dates in filenames and xyplorer date command works well with these, but updates are not made in every day and therefore not in web) and get URL not found error. If I press continue where it should be going to download next file it won't do it. Or it actually goes to next file, but says also for this file that URL not found though this file actually exists and it works ok when command to this file is before command to really missing file. Seems like a bug.

tomuser
Posts: 135
Joined: 04 Dec 2009 18:52

Re: Downloading archives and relative paths

Post by tomuser »

...or feature?

admin
Site Admin
Posts: 66249
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Downloading archives and relative paths

Post by admin »

tomuser wrote:...or feature?
Bug! Thanks, fix comes.

tomuser
Posts: 135
Joined: 04 Dec 2009 18:52

Re: Downloading archives and relative paths

Post by tomuser »

Nice!

Is there any command which could continue script if no file was found with next dowload commands without pressing continue manually so I could just run script and go away and everything which is available will be downloaded?

admin
Site Admin
Posts: 66249
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Downloading archives and relative paths

Post by admin »

tomuser wrote:Nice!

Is there any command which could continue script if no file was found with next dowload commands without pressing continue manually so I could just run script and go away and everything which is available will be downloaded?
No. But it would make sense. Maybe I'll add something.

Post Reply