Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Scripting Explorer FTP

Reply
 
Old 09-21-2007   #1 (permalink)
holf


 
 

Scripting Explorer FTP

Hi,

I was wondering if there was an easy way to script the FTP functionality of
the Windows Explorer shell.

Why might I want to do this? Well, as you probably know, although FTP can
handle multiple file transfers using 'MPUT', it cannot handle transferring a
folder with all content and all recursive subfolders, unless you write some
recursive scripts to do this.

However, the Windows Explorer GUI FTP client does allow you to select an
entire folder on a local drive and dump it into an FTP folder of your choice,
all in one go. It strikes me that this should be something that is possible
to script.

I can start Explorer easily enough at the right location, e.g.:
explorer.exe ftp://ftp.microsoft.com

But I am not too sure where to go from there.


My need is to upload the contents of a folder, including all recursive
subfolders and their contents, to a remote FTP site.
Ideally I would zip my stuff at the local end, transfer a single file and
then unzip at the remote end. But I do not have sufficient permissions to
ubzip on the remote server. FTP access is all I have.

Any thoughts much appreciated, including any alternative ways of doing this
if scripting the Explorer FTP GUI is not possible.

Thanks...

My System SpecsSystem Spec
Old 09-21-2007   #2 (permalink)
Brandon Shell


 
 

Re: Scripting Explorer FTP

http://blog.sapien.com/current/free-...transfers.html

"holf" <holf@xxxxxx> wrote in message
news:6B9707F4-447F-4362-A2F7-338BA9155D37@xxxxxx
Quote:

> Hi,
>
> I was wondering if there was an easy way to script the FTP functionality
> of
> the Windows Explorer shell.
>
> Why might I want to do this? Well, as you probably know, although FTP can
> handle multiple file transfers using 'MPUT', it cannot handle transferring
> a
> folder with all content and all recursive subfolders, unless you write
> some
> recursive scripts to do this.
>
> However, the Windows Explorer GUI FTP client does allow you to select an
> entire folder on a local drive and dump it into an FTP folder of your
> choice,
> all in one go. It strikes me that this should be something that is
> possible
> to script.
>
> I can start Explorer easily enough at the right location, e.g.:
> explorer.exe ftp://ftp.microsoft.com
>
> But I am not too sure where to go from there.
>
>
> My need is to upload the contents of a folder, including all recursive
> subfolders and their contents, to a remote FTP site.
> Ideally I would zip my stuff at the local end, transfer a single file and
> then unzip at the remote end. But I do not have sufficient permissions to
> ubzip on the remote server. FTP access is all I have.
>
> Any thoughts much appreciated, including any alternative ways of doing
> this
> if scripting the Explorer FTP GUI is not possible.
>
> Thanks...
My System SpecsSystem Spec
Old 09-21-2007   #3 (permalink)
holf


 
 

Re: Scripting Explorer FTP

Thanks Brandon, that looks very promising and I will probably end up using it.

I guess I will have to write some recursive routines to parse my directory
tree and copy everything across folder by folder. I have no problem doing
that in C# or VB.net, but I am pretty new to Powershell so it's going to be
an interesting learning experience.

Thanks for the link.



"Brandon Shell" wrote:
Quote:

> http://blog.sapien.com/current/free-...transfers.html
>
> "holf" <holf@xxxxxx> wrote in message
> news:6B9707F4-447F-4362-A2F7-338BA9155D37@xxxxxx
Quote:

> > Hi,
> >
> > I was wondering if there was an easy way to script the FTP functionality
> > of
> > the Windows Explorer shell.
> >
> > Why might I want to do this? Well, as you probably know, although FTP can
> > handle multiple file transfers using 'MPUT', it cannot handle transferring
> > a
> > folder with all content and all recursive subfolders, unless you write
> > some
> > recursive scripts to do this.
> >
> > However, the Windows Explorer GUI FTP client does allow you to select an
> > entire folder on a local drive and dump it into an FTP folder of your
> > choice,
> > all in one go. It strikes me that this should be something that is
> > possible
> > to script.
> >
> > I can start Explorer easily enough at the right location, e.g.:
> > explorer.exe ftp://ftp.microsoft.com
> >
> > But I am not too sure where to go from there.
> >
> >
> > My need is to upload the contents of a folder, including all recursive
> > subfolders and their contents, to a remote FTP site.
> > Ideally I would zip my stuff at the local end, transfer a single file and
> > then unzip at the remote end. But I do not have sufficient permissions to
> > ubzip on the remote server. FTP access is all I have.
> >
> > Any thoughts much appreciated, including any alternative ways of doing
> > this
> > if scripting the Explorer FTP GUI is not possible.
> >
> > Thanks...
>
>
My System SpecsSystem Spec
Old 09-21-2007   #4 (permalink)
Brandon Shell


 
 

Re: Scripting Explorer FTP

I have never used Don's (sapien) cmdlets... but I will help any way I can.
Let me download it and see what I can do quickly

"holf" <holf@xxxxxx> wrote in message
news:AF987B46-0DDE-440A-BC4B-3EFF382487B6@xxxxxx
Quote:

> Thanks Brandon, that looks very promising and I will probably end up using
> it.
>
> I guess I will have to write some recursive routines to parse my directory
> tree and copy everything across folder by folder. I have no problem doing
> that in C# or VB.net, but I am pretty new to Powershell so it's going to
> be
> an interesting learning experience.
>
> Thanks for the link.
>
>
>
> "Brandon Shell" wrote:
>
Quote:

>> http://blog.sapien.com/current/free-...transfers.html
>>
>> "holf" <holf@xxxxxx> wrote in message
>> news:6B9707F4-447F-4362-A2F7-338BA9155D37@xxxxxx
Quote:

>> > Hi,
>> >
>> > I was wondering if there was an easy way to script the FTP
>> > functionality
>> > of
>> > the Windows Explorer shell.
>> >
>> > Why might I want to do this? Well, as you probably know, although FTP
>> > can
>> > handle multiple file transfers using 'MPUT', it cannot handle
>> > transferring
>> > a
>> > folder with all content and all recursive subfolders, unless you write
>> > some
>> > recursive scripts to do this.
>> >
>> > However, the Windows Explorer GUI FTP client does allow you to select
>> > an
>> > entire folder on a local drive and dump it into an FTP folder of your
>> > choice,
>> > all in one go. It strikes me that this should be something that is
>> > possible
>> > to script.
>> >
>> > I can start Explorer easily enough at the right location, e.g.:
>> > explorer.exe ftp://ftp.microsoft.com
>> >
>> > But I am not too sure where to go from there.
>> >
>> >
>> > My need is to upload the contents of a folder, including all recursive
>> > subfolders and their contents, to a remote FTP site.
>> > Ideally I would zip my stuff at the local end, transfer a single file
>> > and
>> > then unzip at the remote end. But I do not have sufficient permissions
>> > to
>> > ubzip on the remote server. FTP access is all I have.
>> >
>> > Any thoughts much appreciated, including any alternative ways of doing
>> > this
>> > if scripting the Explorer FTP GUI is not possible.
>> >
>> > Thanks...
>>
>>
My System SpecsSystem Spec
Old 09-21-2007   #5 (permalink)
Brandon Shell


 
 

Re: Scripting Explorer FTP

nm... Shay has done it already
http://scriptolog.blogspot.com/2007/...utomation.html

"Brandon Shell" <tshell.mask@xxxxxx> wrote in message
news:uXUihPK$HHA.1188@xxxxxx
Quote:

>I have never used Don's (sapien) cmdlets... but I will help any way I can.
>Let me download it and see what I can do quickly
>
> "holf" <holf@xxxxxx> wrote in message
> news:AF987B46-0DDE-440A-BC4B-3EFF382487B6@xxxxxx
Quote:

>> Thanks Brandon, that looks very promising and I will probably end up
>> using it.
>>
>> I guess I will have to write some recursive routines to parse my
>> directory
>> tree and copy everything across folder by folder. I have no problem doing
>> that in C# or VB.net, but I am pretty new to Powershell so it's going to
>> be
>> an interesting learning experience.
>>
>> Thanks for the link.
>>
>>
>>
>> "Brandon Shell" wrote:
>>
Quote:

>>> http://blog.sapien.com/current/free-...transfers.html
>>>
>>> "holf" <holf@xxxxxx> wrote in message
>>> news:6B9707F4-447F-4362-A2F7-338BA9155D37@xxxxxx
>>> > Hi,
>>> >
>>> > I was wondering if there was an easy way to script the FTP
>>> > functionality
>>> > of
>>> > the Windows Explorer shell.
>>> >
>>> > Why might I want to do this? Well, as you probably know, although FTP
>>> > can
>>> > handle multiple file transfers using 'MPUT', it cannot handle
>>> > transferring
>>> > a
>>> > folder with all content and all recursive subfolders, unless you write
>>> > some
>>> > recursive scripts to do this.
>>> >
>>> > However, the Windows Explorer GUI FTP client does allow you to select
>>> > an
>>> > entire folder on a local drive and dump it into an FTP folder of your
>>> > choice,
>>> > all in one go. It strikes me that this should be something that is
>>> > possible
>>> > to script.
>>> >
>>> > I can start Explorer easily enough at the right location, e.g.:
>>> > explorer.exe ftp://ftp.microsoft.com
>>> >
>>> > But I am not too sure where to go from there.
>>> >
>>> >
>>> > My need is to upload the contents of a folder, including all recursive
>>> > subfolders and their contents, to a remote FTP site.
>>> > Ideally I would zip my stuff at the local end, transfer a single file
>>> > and
>>> > then unzip at the remote end. But I do not have sufficient permissions
>>> > to
>>> > ubzip on the remote server. FTP access is all I have.
>>> >
>>> > Any thoughts much appreciated, including any alternative ways of doing
>>> > this
>>> > if scripting the Explorer FTP GUI is not possible.
>>> >
>>> > Thanks...
>>>
>>>
>
My System SpecsSystem Spec
Old 09-22-2007   #6 (permalink)
holf


 
 

Re: Scripting Explorer FTP

Thanks... that's very helpful.

"Brandon Shell" wrote:
Quote:

> nm... Shay has done it already
> http://scriptolog.blogspot.com/2007/...utomation.html
>
> "Brandon Shell" <tshell.mask@xxxxxx> wrote in message
> news:uXUihPK$HHA.1188@xxxxxx
Quote:

> >I have never used Don's (sapien) cmdlets... but I will help any way I can.
> >Let me download it and see what I can do quickly
> >
> > "holf" <holf@xxxxxx> wrote in message
> > news:AF987B46-0DDE-440A-BC4B-3EFF382487B6@xxxxxx
Quote:

> >> Thanks Brandon, that looks very promising and I will probably end up
> >> using it.
> >>
> >> I guess I will have to write some recursive routines to parse my
> >> directory
> >> tree and copy everything across folder by folder. I have no problem doing
> >> that in C# or VB.net, but I am pretty new to Powershell so it's going to
> >> be
> >> an interesting learning experience.
> >>
> >> Thanks for the link.
> >>
> >>
> >>
> >> "Brandon Shell" wrote:
> >>
> >>> http://blog.sapien.com/current/free-...transfers.html
> >>>
> >>> "holf" <holf@xxxxxx> wrote in message
> >>> news:6B9707F4-447F-4362-A2F7-338BA9155D37@xxxxxx
> >>> > Hi,
> >>> >
> >>> > I was wondering if there was an easy way to script the FTP
> >>> > functionality
> >>> > of
> >>> > the Windows Explorer shell.
> >>> >
> >>> > Why might I want to do this? Well, as you probably know, although FTP
> >>> > can
> >>> > handle multiple file transfers using 'MPUT', it cannot handle
> >>> > transferring
> >>> > a
> >>> > folder with all content and all recursive subfolders, unless you write
> >>> > some
> >>> > recursive scripts to do this.
> >>> >
> >>> > However, the Windows Explorer GUI FTP client does allow you to select
> >>> > an
> >>> > entire folder on a local drive and dump it into an FTP folder of your
> >>> > choice,
> >>> > all in one go. It strikes me that this should be something that is
> >>> > possible
> >>> > to script.
> >>> >
> >>> > I can start Explorer easily enough at the right location, e.g.:
> >>> > explorer.exe ftp://ftp.microsoft.com
> >>> >
> >>> > But I am not too sure where to go from there.
> >>> >
> >>> >
> >>> > My need is to upload the contents of a folder, including all recursive
> >>> > subfolders and their contents, to a remote FTP site.
> >>> > Ideally I would zip my stuff at the local end, transfer a single file
> >>> > and
> >>> > then unzip at the remote end. But I do not have sufficient permissions
> >>> > to
> >>> > ubzip on the remote server. FTP access is all I have.
> >>> >
> >>> > Any thoughts much appreciated, including any alternative ways of doing
> >>> > this
> >>> > if scripting the Explorer FTP GUI is not possible.
> >>> >
> >>> > Thanks...
> >>>
> >>>
> >
>
>
My System SpecsSystem Spec
Old 09-22-2007   #7 (permalink)
holf


 
 

Re: Scripting Explorer FTP

I've had a look into this. Unfortunately the COM dll mentioned only has
methods for 'get' and 'put'. I'll need to be creating folders, traversing
folder trees etc. So either I need something more fully featured that I can
access from Powershell, or I'll have to call something else which will do the
job (such as the Explorer Shell).


Alternatively, I've thought of another approach. I can run ASP.net on my
host, so I could just upload a single ZIP file and then run an ASP.net page
on the server which will decompress everything into the right place.

Seems like the best solution as it minimises transfer bandwidth.


Thanks again for you thoughts on all this.



"holf" wrote:
Quote:

> Thanks... that's very helpful.
>
> "Brandon Shell" wrote:
>
Quote:

> > nm... Shay has done it already
> > http://scriptolog.blogspot.com/2007/...utomation.html
> >
> > "Brandon Shell" <tshell.mask@xxxxxx> wrote in message
> > news:uXUihPK$HHA.1188@xxxxxx
Quote:

> > >I have never used Don's (sapien) cmdlets... but I will help any way I can.
> > >Let me download it and see what I can do quickly
> > >
> > > "holf" <holf@xxxxxx> wrote in message
> > > news:AF987B46-0DDE-440A-BC4B-3EFF382487B6@xxxxxx
> > >> Thanks Brandon, that looks very promising and I will probably end up
> > >> using it.
> > >>
> > >> I guess I will have to write some recursive routines to parse my
> > >> directory
> > >> tree and copy everything across folder by folder. I have no problem doing
> > >> that in C# or VB.net, but I am pretty new to Powershell so it's going to
> > >> be
> > >> an interesting learning experience.
> > >>
> > >> Thanks for the link.
> > >>
> > >>
> > >>
> > >> "Brandon Shell" wrote:
> > >>
> > >>> http://blog.sapien.com/current/free-...transfers.html
> > >>>
> > >>> "holf" <holf@xxxxxx> wrote in message
> > >>> news:6B9707F4-447F-4362-A2F7-338BA9155D37@xxxxxx
> > >>> > Hi,
> > >>> >
> > >>> > I was wondering if there was an easy way to script the FTP
> > >>> > functionality
> > >>> > of
> > >>> > the Windows Explorer shell.
> > >>> >
> > >>> > Why might I want to do this? Well, as you probably know, although FTP
> > >>> > can
> > >>> > handle multiple file transfers using 'MPUT', it cannot handle
> > >>> > transferring
> > >>> > a
> > >>> > folder with all content and all recursive subfolders, unless you write
> > >>> > some
> > >>> > recursive scripts to do this.
> > >>> >
> > >>> > However, the Windows Explorer GUI FTP client does allow you to select
> > >>> > an
> > >>> > entire folder on a local drive and dump it into an FTP folder of your
> > >>> > choice,
> > >>> > all in one go. It strikes me that this should be something that is
> > >>> > possible
> > >>> > to script.
> > >>> >
> > >>> > I can start Explorer easily enough at the right location, e.g.:
> > >>> > explorer.exe ftp://ftp.microsoft.com
> > >>> >
> > >>> > But I am not too sure where to go from there.
> > >>> >
> > >>> >
> > >>> > My need is to upload the contents of a folder, including all recursive
> > >>> > subfolders and their contents, to a remote FTP site.
> > >>> > Ideally I would zip my stuff at the local end, transfer a single file
> > >>> > and
> > >>> > then unzip at the remote end. But I do not have sufficient permissions
> > >>> > to
> > >>> > ubzip on the remote server. FTP access is all I have.
> > >>> >
> > >>> > Any thoughts much appreciated, including any alternative ways of doing
> > >>> > this
> > >>> > if scripting the Explorer FTP GUI is not possible.
> > >>> >
> > >>> > Thanks...
> > >>>
> > >>>
> > >
> >
> >
My System SpecsSystem Spec
Old 09-24-2007   #8 (permalink)
Brandon Shell


 
 

Re: Scripting Explorer FTP

Hmmm... Don is on here occasionally, maybe he can comment.

I will also see what I can find... I thought there was a FTPClient in the
Framework.

"holf" <holf@xxxxxx> wrote in message
news:8F1B567C-EEEB-45AF-BF64-2DA2C3C14F3D@xxxxxx
Quote:

> I've had a look into this. Unfortunately the COM dll mentioned only has
> methods for 'get' and 'put'. I'll need to be creating folders, traversing
> folder trees etc. So either I need something more fully featured that I
> can
> access from Powershell, or I'll have to call something else which will do
> the
> job (such as the Explorer Shell).
>
>
> Alternatively, I've thought of another approach. I can run ASP.net on my
> host, so I could just upload a single ZIP file and then run an ASP.net
> page
> on the server which will decompress everything into the right place.
>
> Seems like the best solution as it minimises transfer bandwidth.
>
>
> Thanks again for you thoughts on all this.
>
>
>
> "holf" wrote:
>
Quote:

>> Thanks... that's very helpful.
>>
>> "Brandon Shell" wrote:
>>
Quote:

>> > nm... Shay has done it already
>> > http://scriptolog.blogspot.com/2007/...utomation.html
>> >
>> > "Brandon Shell" <tshell.mask@xxxxxx> wrote in message
>> > news:uXUihPK$HHA.1188@xxxxxx
>> > >I have never used Don's (sapien) cmdlets... but I will help any way I
>> > >can.
>> > >Let me download it and see what I can do quickly
>> > >
>> > > "holf" <holf@xxxxxx> wrote in message
>> > > news:AF987B46-0DDE-440A-BC4B-3EFF382487B6@xxxxxx
>> > >> Thanks Brandon, that looks very promising and I will probably end up
>> > >> using it.
>> > >>
>> > >> I guess I will have to write some recursive routines to parse my
>> > >> directory
>> > >> tree and copy everything across folder by folder. I have no problem
>> > >> doing
>> > >> that in C# or VB.net, but I am pretty new to Powershell so it's
>> > >> going to
>> > >> be
>> > >> an interesting learning experience.
>> > >>
>> > >> Thanks for the link.
>> > >>
>> > >>
>> > >>
>> > >> "Brandon Shell" wrote:
>> > >>
>> > >>> http://blog.sapien.com/current/free-...transfers.html
>> > >>>
>> > >>> "holf" <holf@xxxxxx> wrote in message
>> > >>> news:6B9707F4-447F-4362-A2F7-338BA9155D37@xxxxxx
>> > >>> > Hi,
>> > >>> >
>> > >>> > I was wondering if there was an easy way to script the FTP
>> > >>> > functionality
>> > >>> > of
>> > >>> > the Windows Explorer shell.
>> > >>> >
>> > >>> > Why might I want to do this? Well, as you probably know, although
>> > >>> > FTP
>> > >>> > can
>> > >>> > handle multiple file transfers using 'MPUT', it cannot handle
>> > >>> > transferring
>> > >>> > a
>> > >>> > folder with all content and all recursive subfolders, unless you
>> > >>> > write
>> > >>> > some
>> > >>> > recursive scripts to do this.
>> > >>> >
>> > >>> > However, the Windows Explorer GUI FTP client does allow you to
>> > >>> > select
>> > >>> > an
>> > >>> > entire folder on a local drive and dump it into an FTP folder of
>> > >>> > your
>> > >>> > choice,
>> > >>> > all in one go. It strikes me that this should be something that
>> > >>> > is
>> > >>> > possible
>> > >>> > to script.
>> > >>> >
>> > >>> > I can start Explorer easily enough at the right location, e.g.:
>> > >>> > explorer.exe ftp://ftp.microsoft.com
>> > >>> >
>> > >>> > But I am not too sure where to go from there.
>> > >>> >
>> > >>> >
>> > >>> > My need is to upload the contents of a folder, including all
>> > >>> > recursive
>> > >>> > subfolders and their contents, to a remote FTP site.
>> > >>> > Ideally I would zip my stuff at the local end, transfer a single
>> > >>> > file
>> > >>> > and
>> > >>> > then unzip at the remote end. But I do not have sufficient
>> > >>> > permissions
>> > >>> > to
>> > >>> > ubzip on the remote server. FTP access is all I have.
>> > >>> >
>> > >>> > Any thoughts much appreciated, including any alternative ways of
>> > >>> > doing
>> > >>> > this
>> > >>> > if scripting the Explorer FTP GUI is not possible.
>> > >>> >
>> > >>> > Thanks...
>> > >>>
>> > >>>
>> > >
>> >
>> >
My System SpecsSystem Spec
Old 09-24-2007   #9 (permalink)
Lance


 
 

Re: Scripting Explorer FTP

On Sep 22, 4:12 am, holf <h...@xxxxxx> wrote:
Quote:

> I've had a look into this. Unfortunately the COM dll mentioned only has
> methods for 'get' and 'put'. I'll need to be creating folders, traversing
> folder trees etc. So either I need something more fully featured that I can
> access from Powershell, or I'll have to call something else which will do the
> job (such as the Explorer Shell).
The NetCmdlets get-ftp and send-ftp cmdlets can handle this:
www.nsoftware.com/powershell/.

Lance
http://geekswithblogs.net/Lance

My System SpecsSystem Spec
Old 09-24-2007   #10 (permalink)
holf


 
 

Re: Scripting Explorer FTP

Thanks, Lance.

I've ended up uploading a Zip file and then using ASP.net to do the
unpacking at the other end. It is working well so I'll probably stick with
that.

Thanks very much to Brandon and Lance for their replies.



"Lance" wrote:
Quote:

> On Sep 22, 4:12 am, holf <h...@xxxxxx> wrote:
Quote:

> > I've had a look into this. Unfortunately the COM dll mentioned only has
> > methods for 'get' and 'put'. I'll need to be creating folders, traversing
> > folder trees etc. So either I need something more fully featured that I can
> > access from Powershell, or I'll have to call something else which will do the
> > job (such as the Explorer Shell).
>
> The NetCmdlets get-ftp and send-ftp cmdlets can handle this:
> www.nsoftware.com/powershell/.
>
> Lance
> http://geekswithblogs.net/Lance
>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Scripting question Vista General
PS Scripting Issue PowerShell
VB scripting help VB Script
UAC and scripting Vista General
Scripting bug? PowerShell


Vista Forums 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 Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46