Batch file to download data from url - file

The website link is http://www.nrldc.in/WBS/DrwlSch.aspx?dt=%DATE%&st=DELHI .
required a batch code to download the data from the URrl .
OR how can I download the data from URL through Batch file
Anyone please help
Tom

to do this you must use an external msdos application such as curl or wget!
and example would be:
"%myfiles%\wget.exe" --no-check-certificate -O "game\Update.zip" http://dl.dropbox.com/s/0kafa8pmnz6wivn/Update.zip
you can get wget from:
http://www.gnu.org/software/wget/

How can I download a file with batch file without using any external tools?
My attempt to resume ways of how file can be downloaded on windows.

Related

Using wget but only getting html files

I am trying to download multiple NETCDF files from NASA website.
So I was following their tutorial of how to download multiple files using wget for windows(https://disc.gsfc.nasa.gov/data-access#windows_wget).
When I try to use the option to dowload multiple data files at once, the output is only returning to me html files and not the netcdf files. Does anyone know what can be happening?
Ps.: I am executing with the following command:
wget --load-cookies C:\.urs_cookies --save-cookies C:\.urs_cookies --auth-no-challenge=on --keep-session-cookies --user=<your username> --ask-password --content-disposition -i <url.txt>

download multiple files from sftp with Jenkins

I have to download all files from a ftp folder using Explicit FTP over SSL/TLS. I need that for a jenkins job, running on a windows machine and didnt find any plugins - so I am trying to use a batch script with curl and the following code lists the contents of the folder.
set "$FILEPATH=C:\temp"
set "$REMOTEPATH=/files/"
curl -u user:pass --ftp-ssl ftp://hostame.com:port%$REMOTEPATH% -o %$FILEPATH%
I figured out that with curl I have to download files one by one, but how can I achieve to go through all the files in a ftp directory and get them one by one?
Is there a better way to achieve that? I read about mget, but it doesnt seem to work with the explicit ftp over ssl.
Thanks
I couldnt bring it to work with batch directly in the script, so I wrote a python script instead and download it from git and execute it as a step in the pypeline. It has some nice libraries, so it works as a charm.

What "option" to use with "WGET" for selecting only few files with particular extension from a FTP directory

I am trying to download files with particular datestamp as an extension from a folder through FTP server. Since the folder contains all other files, I wanted to download only files with a particular datestamp.
I tried using wget files_datestamp*.extension, which didn't work.
I also tried using wget -i files_datestamp*.extension, which downloads all.
My question is: What option to use with wget to download only particular files that I am interested in?
wget http://collaboration.cmc.ec.gc.ca/cmc/CMOI/NetCDF/NMME/1p0deg/#%23%23/CanCM3_201904_r4i1p1_20190501*.nc4
The link you've shared is over HTTP and not FTP. As a result, it is not possible to glob over the filenames, that is feasible only over FTP.
With HTTP, it is imperative that you have access to a directory listing page which tells you which files are available. Then use -r --accept-regex=<regex here> to download your files

Need to download file on website from command line

I have a link on my website that when clicked dynamically creates a csv file and downloads the file. I need a way to do this in a batch file so that the file can be downloaded automatically (via task scheduler). I have played around with wget but I can't get the file. Thank you in advance for your help!
bitsadmin.exe /transfer "Job Name" downloadUrl destination
If you are using Windows 7 then use same command in Power Shell
Note:
downloadUrl : It is the download url from referred website
destination : It is path of the file where we need to download it.
I use it as follows:
#plain wget
wget "http://blah.com:8080/etc/myjar.jar"
#wget but skirting proxy settings
wget --no-proxy "http://blah.com:8080/etc/myjar.jar"
Or to download to a specific filename (perhaps to enable consistent naming in scripts):
wget -O myjar.jar --no-proxy "http://blah.com:8080/etc/myjar1.jar"
If you're having issues, ensure wget logging is on and possibly debug (which will be augmented with your logging):
# additional logging
wget -o myjar1.jar.log "http://blah.com:8080/etcetcetc/myjar1.jar"
#debug (if wget was compiled with debug symbols only!)
wget -o myjar1.jar.log -d "http://blah.com:8080/etc/myjar1.jar"
Additional checks you may need to do if still no success:
Can you ping the target host?
Can you "see" the target file in a browser?
Is the target file actually on the server?

Write a batch file to download a .exe app from the internet

I have to write a batch file to download a .exe application and I am finding it very difficult to make sense of the whole process.
All I have got done so far is;
start /d C:"\Program Files <x86>\Google\Chrome\Application"
chrome.exe http://website/directory
This brings up the page I want to go to and the .exe file is on this page, but I don'y know how to download it, I tried;
start /d C:"\Program Files <x86>\Google\Chrome\Application"
chrome.exe http://website/directory/download.exe
This was no good, it tried to load the page, while I thought it would just download the file.
If anyone can give me some insight into this, it would be great
Do not use chrome. Depending on the tools you can rely on, use for example wget or curl. For documentation, have a look at the project's homepages (wget, curl), basic invokation is easy:
wget -o outfile http://example.com/url/to/file
curl -o outfile http://example.com/url/to/file
You may need to change:
http://www.
to
ftp://ftp.
It would help if you provided the actual internet file link.

Resources