Download and unzip file Batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
switchy
Posts: 17
Joined: 09 Feb 2019 05:55

Download and unzip file Batch

#1 Post by switchy » 09 Feb 2019 06:26

Hello, can you please tell me how to download and unzip .zip file, I need to install PHP with batch is there possible?

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Download and unzip file Batch

#2 Post by Ed Dyreen » 09 Feb 2019 07:08

switchy wrote:
09 Feb 2019 06:26
Hello, can you please tell me how to download and unzip .zip file, I need to install PHP with batch is there possible?
Many use wget to download the file and a command line version of 7zip to extract the files.

switchy
Posts: 17
Joined: 09 Feb 2019 05:55

Re: Download and unzip file Batch

#3 Post by switchy » 09 Feb 2019 10:38

can you please get an example of wget download?

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Download and unzip file Batch

#4 Post by Ed Dyreen » 09 Feb 2019 10:45

switchy wrote:
09 Feb 2019 10:38
can you please get an example of wget download?
Many. I have never actually used wget myself though.

npocmaka_
Posts: 481
Joined: 24 Jun 2013 17:10
Location: Bulgaria
Contact:

Re: Download and unzip file Batch

#5 Post by npocmaka_ » 09 Feb 2019 14:21

Check this and this

switchy
Posts: 17
Joined: 09 Feb 2019 05:55

Re: Download and unzip file Batch

#6 Post by switchy » 09 Feb 2019 16:52

here is the situation, so i have a few windows machines, i need a simple script that will figure the windows is 64 bit or 86 bit then if it is 64 bit download php archive for 64 bit machine and unzip it ... and if 86 bit download 86 bit php archive file and unzip it... that is possible yes?

BitTransfer is always gives me an error : Start-BitsTransfer : The connection with the server was terminated abnormally

Squashman
Expert
Posts: 4107
Joined: 23 Dec 2011 13:59

Re: Download and unzip file Batch

#7 Post by Squashman » 09 Feb 2019 20:16

switchy wrote:
09 Feb 2019 16:52
here is the situation
What were you able to gleen from the links you were directed to?

switchy
Posts: 17
Joined: 09 Feb 2019 05:55

Re: Download and unzip file Batch

#8 Post by switchy » 10 Feb 2019 01:29

well I have tried many variants and they all give errors:
the connection with the server was terminated abnormally
error code 0x80072efe bitsadmin
why it is so complicated ((

Squashman
Expert
Posts: 4107
Joined: 23 Dec 2011 13:59

Re: Download and unzip file Batch

#9 Post by Squashman » 10 Feb 2019 09:38

How can we help you unless you show us the code you are trying to use?

switchy
Posts: 17
Joined: 09 Feb 2019 05:55

Re: Download and unzip file Batch

#10 Post by switchy » 10 Feb 2019 10:21

Code: Select all

bitsadmin /transfer myDownloadJob /download /priority normal https://windows.php.net/downloads/releases/php-7.3.2-nts-Win32-VC15-x64.zip c:\10mb.zip
that script gives an error : The connection with the server was terminated abnormally

Code: Select all

$source = 'https://windows.php.net/downloads/releases/php-7.3.2-nts-Win32-VC15-x64.zip'
$dest = 'c:\php.zip'
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($source, $dest)
that script gives an error : Exception calling "DownloadFile" with "2" argument(s): "The underlying connection was closed: An unexpected error occurred on a s
end."

Squashman
Expert
Posts: 4107
Joined: 23 Dec 2011 13:59

Re: Download and unzip file Batch

#11 Post by Squashman » 10 Feb 2019 12:00

Default Windows permissions restrict you from writing directly to the root of the system drive. That has been in place since Windows Vista. So like well over 12 years already

penpen
Expert
Posts: 1713
Joined: 23 Jun 2013 06:15
Location: Germany

Re: Download and unzip file Batch

#12 Post by penpen » 10 Feb 2019 14:05

ANother option would be using certutil for downloading:
viewtopic.php?f=3&t=8485.

penpen

switchy
Posts: 17
Joined: 09 Feb 2019 05:55

Re: Download and unzip file Batch

#13 Post by switchy » 10 Feb 2019 14:13

Squashman wrote:
10 Feb 2019 12:00
Default Windows permissions restrict you from writing directly to the root of the system drive. That has been in place since Windows Vista. So like well over 12 years already
and is there possible to bypass it because php folder need to be in the system drive

switchy
Posts: 17
Joined: 09 Feb 2019 05:55

Re: Download and unzip file Batch

#14 Post by switchy » 10 Feb 2019 14:20

penpen wrote:
10 Feb 2019 14:05
ANother option would be using certutil for downloading:
viewtopic.php?f=3&t=8485.

penpen
here is an error that is given by that utility:
CertUtil: -URLCache command FAILED: 0x80072efd (WIN32: 12029)
CertUtil: A connection with the server could not be established

Squashman
Expert
Posts: 4107
Joined: 23 Dec 2011 13:59

Re: Download and unzip file Batch

#15 Post by Squashman » 10 Feb 2019 14:56

switchy wrote:
10 Feb 2019 14:13
Squashman wrote:
10 Feb 2019 12:00
Default Windows permissions restrict you from writing directly to the root of the system drive. That has been in place since Windows Vista. So like well over 12 years already
and is there possible to bypass it because php folder need to be in the system drive
I never said or eluded to that you could not create a directory.

Post Reply