Download and unzip file Batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Squashman
Expert
Posts: 4048
Joined: 23 Dec 2011 13:59

Re: Download and unzip file Batch

#16 Post by Squashman » 10 Feb 2019 15:22

switchy wrote:
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
Works just fine for me.

Code: Select all

C:\PHP>certutil.exe -urlcache -split -f "https://windows.php.net/downloads/releases/php-7.3.2-nts-Win32-VC15-x64.zip" php-7.3.2-nts-Win32-VC15-x64.zip
****  Online  ****
  000000  ...
  182f721
CertUtil: -URLCache command completed successfully.

C:\PHP>dir
 Volume in drive C has no label.
 Volume Serial Number is E6F4-3561

 Directory of C:\PHP

02/10/2019  03:21 PM    <DIR>          .
02/10/2019  03:21 PM    <DIR>          ..
02/10/2019  03:20 PM        25,360,161 php-7.3.2-nts-Win32-VC15-x64.zip
               1 File(s)     25,360,161 bytes
               2 Dir(s)  709,752,074,240 bytes free

C:\PHP>

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

Re: Download and unzip file Batch

#17 Post by switchy » 10 Feb 2019 15:23

Squashman wrote:
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.
create a directory in system drive?

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

Re: Download and unzip file Batch

#18 Post by switchy » 10 Feb 2019 15:24

Squashman wrote:
10 Feb 2019 15:22
switchy wrote:
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
Works just fine for me.

Code: Select all

C:\PHP>certutil.exe -urlcache -split -f "https://windows.php.net/downloads/releases/php-7.3.2-nts-Win32-VC15-x64.zip" php-7.3.2-nts-Win32-VC15-x64.zip
****  Online  ****
  000000  ...
  182f721
CertUtil: -URLCache command completed successfully.

C:\PHP>dir
 Volume in drive C has no label.
 Volume Serial Number is E6F4-3561

 Directory of C:\PHP

02/10/2019  03:21 PM    <DIR>          .
02/10/2019  03:21 PM    <DIR>          ..
02/10/2019  03:20 PM        25,360,161 php-7.3.2-nts-Win32-VC15-x64.zip
               1 File(s)     25,360,161 bytes
               2 Dir(s)  709,752,074,240 bytes free

C:\PHP>
i have still that error

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

Re: Download and unzip file Batch

#19 Post by Squashman » 10 Feb 2019 16:05

switchy wrote:
10 Feb 2019 15:24
i have still that error
Care to share the execution and output with everyone?

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

Re: Download and unzip file Batch

#20 Post by Squashman » 10 Feb 2019 16:25

Bitsadmin also worked for me.

Code: Select all

C:\php>bitsadmin /transfer myDownloadJob /download /priority normal https://windows.php.net/downloads/releases/php-7.3.2-nts-Win32-VC15-x64.zip C:\php\php-7.3.2-nts-Win32-VC15-x64.zip
DISPLAY: 'myDownloadJob' TYPE: DOWNLOAD STATE: TRANSFERRED
PRIORITY: NORMAL FILES: 1 / 1 BYTES: 25360161 / 25360161 (100%)
Transfer complete.

C:\PHP>dir /b
php-7.3.2-nts-Win32-VC15-x64.zip

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

Re: Download and unzip file Batch

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

i have windows 7 sp1... i want to install it on C:\windows\system32

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

Re: Download and unzip file Batch

#22 Post by Ed Dyreen » 10 Feb 2019 18:15

switchy wrote:
10 Feb 2019 16:35
i have windows 7 sp1... i want to install it on C:\windows\system32
You want to install a non critical program to a directory that is specifically not designed for that purpose ? The windows folder contains system related files, from dynamic link libraries to topology that allows for system restore and sysprep. this directory is searched and enumerated all the time. The larger this directory, "the more non critical data", the slower, unstable, and more difficult to maintain the entire system.

Why not use it how Microsoft intended and install in "C:\program files\PHP\" ?

Programs decide what needs to be part of windows folder, often because they add some critical functionality to the system or the data is shared between applications or system files need to be updated etcetera..

I'd leave that folder alone.

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

Re: Download and unzip file Batch

#23 Post by switchy » 10 Feb 2019 23:43

and in program files folder it will work?

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

Re: Download and unzip file Batch

#24 Post by switchy » 11 Feb 2019 01:45

still get an error
Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request."
At line:4 char:17
+ $wc.DownloadFile <<<< ($source, $dest)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException

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

Re: Download and unzip file Batch

#25 Post by switchy » 11 Feb 2019 03:45

i have one question so i have powershell 2.0 is there possible to import some linux command line features, for example apt-get... i guess then i just could install php with apt-get install php, am i wrong?

ShadowThief
Expert
Posts: 878
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Download and unzip file Batch

#26 Post by ShadowThief » 11 Feb 2019 04:53

I think you're thinking of Chcolatey. apt-get has not been ported to Windows.

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

Re: Download and unzip file Batch

#27 Post by Squashman » 11 Feb 2019 10:48

switchy wrote:
11 Feb 2019 01:45
still get an error
Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request."
At line:4 char:17
+ $wc.DownloadFile <<<< ($source, $dest)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
If Certutil, Bitsadmin and Powershell are not working on your computer, I would think there is something wrong with your computer or network.

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

Re: Download and unzip file Batch

#28 Post by switchy » 11 Feb 2019 13:22

ShadowThief wrote:
11 Feb 2019 04:53
I think you're thinking of Chcolatey. apt-get has not been ported to Windows.
what exactly doing chocolatey?

ShadowThief
Expert
Posts: 878
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Download and unzip file Batch

#29 Post by ShadowThief » 11 Feb 2019 18:47

It's a program you install that lets you download software from various repositories, like how apt-get does. It's the closest thing you're gonna get.

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

Re: Download and unzip file Batch

#30 Post by switchy » 12 Feb 2019 01:57

Squashman wrote:
11 Feb 2019 10:48
switchy wrote:
11 Feb 2019 01:45
still get an error
Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request."
At line:4 char:17
+ $wc.DownloadFile <<<< ($source, $dest)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
If Certutil, Bitsadmin and Powershell are not working on your computer, I would think there is something wrong with your computer or network.
I have tried from different networks, but if it is something wrong with windows, how can i fix it? is there something maybe to update?

Post Reply