Page 1 of 1

‘p’ is not recognized as an internal or external command, operable program or batch file when using wget on Windows10

Posted: Mon May 30, 2022 5:06 am America/New_York
by yang16
Hello~

I want to download all the URLs in a file called http_manifest.txt using Wget on Windows 10. The file was obtained after ordering VIIRS L2 data from NASA Ocean Color. However, when I ran Wget for one URL using this command: wget https://oceandata.sci.gsfc.nasa.gov/cgi/getfile/requested_files_1.tar?h=ocdist309&p=/data1/7060517533972d6a/requested_files, I got an error as bellow:

I wonder what is 'p'? Does anyone know how to fix this issue?
In addition, is it possible to download all URLs in the http_manifest.txt file using wget?

Thank you in advance.
Elaine.

Re: ‘p’ is not recognized as an internal or external command, operable program or batch file when using wget on Windows1

Posted: Tue May 31, 2022 1:22 pm America/New_York
by OB.DAAC - amscott
Can you try the instructions here and let us know if you are able to obtain your files?
https://oceancolor.gsfc.nasa.gov/data/download_methods/#orders_sec

Re: ‘p’ is not recognized as an internal or external command, operable program or batch file when using wget on Windows1

Posted: Tue May 31, 2022 10:20 pm America/New_York
by yang16
Thank you for your reply. Yes, I tried the instructions in that website. Specifically, when I ran "wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on --no-check-certificate --content-disposition -i https://oceandata.sci.gsfc.nasa.gov/cgi/getfile/requested_files_1.tar?h=ocdist309&p=/data1/7060517533972d6a/requested_files", I got an error as below:
2.JPG
2.JPG (31.48 KiB) Not viewed yet
Do you know how to fix this issue?

Thank you in advance.
Elaine.

Re: ‘p’ is not recognized as an internal or external command, operable program or batch file when using wget on Windows1

Posted: Wed Jun 01, 2022 12:37 pm America/New_York
by gnwiii
Although they don't seem to mention it, the instructions at <https://oceancolor.gsfc.nasa.gov/data/download_methods/> are for linux or macOS and will need extensive changes for use on Windows. In my experience, there are many versions of wget.exe for Windows, but many are
old or otherwise limited and do not work well. The python script does work reliably on Windows.

Note that you should check the name and permissions of your ".netrc" file.

Re: ‘p’ is not recognized as an internal or external command, operable program or batch file when using wget on Windows1

Posted: Wed Jun 01, 2022 1:20 pm America/New_York
by qinger
Hi Elaine,

I think you need to configure your username and password for authentication using a .netrc file following the instruction on the following page:
https://oceancolor.gsfc.nasa.gov/data/download_methods/#netrc

Please let us know whether this helps.
Guoqing

Re: ‘p’ is not recognized as an internal or external command, operable program or batch file when using wget on Windows1

Posted: Wed Jun 01, 2022 3:07 pm America/New_York
by OB.DAAC - SeanBailey
Seems the "p" is incorrectly being interpreted as a command line option to wget. Try putting the URL in quotes, e.g.:

wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on --no-check-certificate --content-disposition -i
"https://oceandata.sci.gsfc.nasa.gov/cgi/getfile/requested_files_1.tar?h=ocdist309&p=/data1/7060517533972d6a/requested_files"

Sean