🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.msdos.batch.nt
5 messages
5 total messages Started by Jean-Pierre Coulon Sat, 14 Nov 2026 07:20
How to redirect an image output to a file?
#2
Author: Jean-Pierre Coulon
Date: Sat, 14 Nov 2026 07:20
12 lines
1367 bytes
Of course I know how to redirect a text output to a file with 
mycommand.bat>myoutput.txt
But suppose the output is a Web image, e.g. my command is
start " " "C:\Program Files\Google\Chrome\Application\chrome.exe" 
https://gallica.bnf.fr/iiif/ark:/12148/btv1b10542322t/f15/full/full/0/native.jpg
How can I redirect this image to an image on mycomputer? 
mycommand>myimage.jpg gives a 0-byte image.
Of course I can manually save this image with this browser but I want an 
automatic save.

-- 
Jean-Pierre Coulon
Re: How to redirect an image output to a file?
#3
Author: R.Wieser
Date: Sat, 14 Nov 2026 08:01
21 lines
1829 bytes
Jean-Pierre,

> start " " "C:\Program Files\Google\Chrome\Application\chrome.exe" 
> https://gallica.bnf.fr/iiif/ark:/12148/btv1b10542322t/f15/full/full/0/native.jpg
> How can I redirect this image to an image on mycomputer?

You don't.

mycommand.bat writes something to the console, which is why you can redirect 
it.

Chrome.exe is a *displaying* GUI program, not writing anything to the 
console.  iow, there is nothing to redirect.

What you *could* do is to look for a program which downloads the file and 
saves it to disk.  Perhaps a program like curl ?

Regards,
Rudy Wieser

Re: How to redirect an image output to a file?
#4
Author: Herbert Kleebauer
Date: Sat, 14 Nov 2026 12:39
29 lines
2389 bytes
On 11/14/2026 9:01 AM, R.Wieser wrote:
> Jean-Pierre,
> 
>> start " " "C:\Program Files\Google\Chrome\Application\chrome.exe" 
>> https://gallica.bnf.fr/iiif/ark:/12148/btv1b10542322t/f15/full/full/0/native.jpg
>> How can I redirect this image to an image on mycomputer?


> What you *could* do is to look for a program which downloads the file and
> saves it to disk.  Perhaps a program like curl ?
You don't have to look for curl, it is already part of Windows.

curl https://www.nasa.gov/wp-content/uploads/2026/11/at2016blu.jpg>a.jpg

will download the NASA picture of the day and save it as a.jpg.

But this doesn't work with your picture, because the site suppose
you are a bot and will not deliver the picture. Maybe you have to
send a fake header that the request is made by Firefox and not curl.
Read the documentation of curl or ask an AI how to do it.

Or you can do it with Powershell. Start Firefox:

start firefox https://gallica.bnf.fr/iiif/ark:/12148/btv1b10542322t/f15/full/full/0/native.jpg

and then send a <CTRL>-S RETURN <CTRL>-W  from the Powershell script
to Firefox.

Re: How to redirect an image output to a file?
#5
Author: R.Wieser
Date: Sat, 14 Nov 2026 13:11
22 lines
1872 bytes
Herbert,

> will download the NASA picture of the day and save it as a.jpg.
>
> But this doesn't work with your picture,
...
> Maybe you have to send a fake header

Possible.  It might be something as simple as adding the "host" entry.  At 
least, that is what my downloader does, and it retrieves the image 
successfully.

> and then send a <CTRL>-S RETURN <CTRL>-W  from the Powershell script
> to Firefox.

If the OS doesn't include PowerShell, AutoIt might also work.   Though 
blindly sending keystrokes is just asking for trouble ...

Regards,
Rudy Wieser

Re: How to redirect an image output to a file?
#6
Author: R.Wieser
Date: Sat, 14 Nov 2026 13:19
8 lines
1537 bytes
> Possible.  It might be something as simple as adding the "host" entry.
> At least, that is what my downloader does, and it retrieves the image 
> successfully.

Whoops !  It also sends a "user-agent" entry.

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads