Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Saving a web graphics file

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 03-19-2007   #1 (permalink)
Mark Masters
Guest


 

Saving a web graphics file

Could someone point in the right direction here. I'd like to do a script that
asks me several questions (or lets me fill in some input data controls) and
then retrieves a graphics file from a web site and writes that file to disk.

The input data shouldn't be too hard to figure out, but I'm not sure what I'm
looking for to get a file from a web site and then write it to disk.

Is PowerShell a good way to do this? Sounds pretty straight forward but I
haven't seen any examples of doing this.

Thanks,
Mark


My System SpecsSystem Spec
Old 03-19-2007   #2 (permalink)
Andrew Savinykh
Guest


 

Re: Saving a web graphics file

I'm quite surprised that you haven't find eny examples, because I came
across a lot. Can't remeber any link right now but basically you do this:

$wc = new-object net.webclient
$wc.DownloadFile("http://msdn2.microsoft.com/msdn/Controls/IntegratedBannerCtrl/en-us/msdn.jpg",
"c:\msdn.jpg");

I.e. you use standard .net class named WebClient
http://msdn2.microsoft.com/en-us/lib...nt(vs.80).aspx
to retreive the data you need.

//Andrew

Mark Masters wrote:
> Could someone point in the right direction here. I'd like to do a script that
> asks me several questions (or lets me fill in some input data controls) and
> then retrieves a graphics file from a web site and writes that file to disk.
>
> The input data shouldn't be too hard to figure out, but I'm not sure what I'm
> looking for to get a file from a web site and then write it to disk.
>
> Is PowerShell a good way to do this? Sounds pretty straight forward but I
> haven't seen any examples of doing this.
>
> Thanks,
> Mark
>

My System SpecsSystem Spec
Old 03-20-2007   #3 (permalink)
Mark Masters
Guest


 

Re: Saving a web graphics file

On Mon, 19 Mar 2007 18:32:04 +1200, Andrew Savinykh <andrewsav@gmail.com>
wrote:

>I'm quite surprised that you haven't find eny examples, because I came
>across a lot. Can't remeber any link right now but basically you do this:
>
>$wc = new-object net.webclient
>$wc.DownloadFile("http://msdn2.microsoft.com/msdn/Controls/IntegratedBannerCtrl/en-us/msdn.jpg",
>"c:\msdn.jpg");
>
>I.e. you use standard .net class named WebClient
>http://msdn2.microsoft.com/en-us/lib...nt(vs.80).aspx
>to retreive the data you need.
>
>//Andrew
>
>Mark Masters wrote:
>> Could someone point in the right direction here. I'd like to do a script that
>> asks me several questions (or lets me fill in some input data controls) and
>> then retrieves a graphics file from a web site and writes that file to disk.
>>
>> The input data shouldn't be too hard to figure out, but I'm not sure what I'm
>> looking for to get a file from a web site and then write it to disk.
>>
>> Is PowerShell a good way to do this? Sounds pretty straight forward but I
>> haven't seen any examples of doing this.
>>
>> Thanks,
>> Mark
>>


Thanks!

My System SpecsSystem Spec
Old 03-20-2007   #4 (permalink)
Thomas Lee
Guest


 

Re: Saving a web graphics file

In message <e4HATBfaHHA.2448@TK2MSFTNGP02.phx.gbl>, Andrew Savinykh
<andrewsav@gmail.com> writes
>I.e. you use standard .net class named WebClient
>http://msdn2.microsoft.com/en-us/lib...ent(vs.80).asp
>x
>to retreive the data you need.


Thanks for the pointer.

As it turns out, this page has some new community content (i.e. the
sample converted into powershell).

:-)
--
Thomas Lee
doctordns@gmail.com
MVP - Admin Frameworks and Security
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving a download file kc2chong Vista music pictures video 1 06-14-2008 05:14 PM
Vista not saving File! NateXSG Vista file management 4 05-27-2008 01:53 AM
saving file from internet Becky Vista music pictures video 2 08-27-2007 06:26 PM
Saving audio file in wav instead of wma Jules Vista music pictures video 1 07-04-2007 02:30 PM
Saving a .pdf file to folder no spam Vista security 7 04-02-2007 12:57 AM


Update your Vista Drivers Update Your Drivers Now!!

Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008