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 - Write-Progess of Copy-Item

Reply
 
Old 11-16-2006   #1 (permalink)
Rick Glos


 
 

Write-Progess of Copy-Item

Hi,

I was copying 1 large file to the network, a Virtual Hard Disk (4GB) to
be exact, and was thinking it would be nice to see progress instead of
it just sitting there and me looking at Process Explorer to make sure
it's doing it.

Has anyone done or seen this?

I can't think of way with Copy-Item or xcopy unless using some kind of
delegate method that checks file size...

Perhaps using FileStream in combine with a Read() using a while loop?

Any suggestions?

Thanks,
Rick


My System SpecsSystem Spec
Old 11-16-2006   #2 (permalink)
dreeschkind


 
 

RE: Write-Progess of Copy-Item

This is a good idea.
"-writeprogress" could be an ubiq... I mean common cmdlet parameter for all
cmdlets that might need some more time for processing (e.g. Move-Item). If I
remember correctly, some of the Exchange Cmdlets for moving mailboxes support
this out of the box. Would be nice to have this also in the Core cmdlets.

--
greetings
dreeschkind

"Rick Glos" wrote:

> Hi,
>
> I was copying 1 large file to the network, a Virtual Hard Disk (4GB) to
> be exact, and was thinking it would be nice to see progress instead of
> it just sitting there and me looking at Process Explorer to make sure
> it's doing it.
>
> Has anyone done or seen this?
>
> I can't think of way with Copy-Item or xcopy unless using some kind of
> delegate method that checks file size...
>
> Perhaps using FileStream in combine with a Read() using a while loop?
>
> Any suggestions?
>
> Thanks,
> Rick
>
>

My System SpecsSystem Spec
Old 11-16-2006   #3 (permalink)
Lee Holmes [MSFT]


 
 

Re: Write-Progess of Copy-Item

Robocopy is a good utility for this.

Once you start caring about file progress over a network connection, you
start caring about a lot of other stuff, too.

--
Lee Holmes [MSFT]
Windows PowerShell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.


"dreeschkind" <dreeschkind@discussions.microsoft.com> wrote in message
news:C5F97A75-46E7-40CF-8573-84B0A0F57D02@microsoft.com...
> This is a good idea.
> "-writeprogress" could be an ubiq... I mean common cmdlet parameter for
> all
> cmdlets that might need some more time for processing (e.g. Move-Item). If
> I
> remember correctly, some of the Exchange Cmdlets for moving mailboxes
> support
> this out of the box. Would be nice to have this also in the Core cmdlets.
>
> --
> greetings
> dreeschkind
>
> "Rick Glos" wrote:
>
>> Hi,
>>
>> I was copying 1 large file to the network, a Virtual Hard Disk (4GB) to
>> be exact, and was thinking it would be nice to see progress instead of
>> it just sitting there and me looking at Process Explorer to make sure
>> it's doing it.
>>
>> Has anyone done or seen this?
>>
>> I can't think of way with Copy-Item or xcopy unless using some kind of
>> delegate method that checks file size...
>>
>> Perhaps using FileStream in combine with a Read() using a while loop?
>>
>> Any suggestions?
>>
>> Thanks,
>> Rick
>>
>>



My System SpecsSystem Spec
Old 11-17-2006   #4 (permalink)
Alex K. Angelopoulos [MVP]


 
 

Re: Write-Progess of Copy-Item

Which reinforces the point that PowerShell should _not_ be treated as a
"replacement" for anything automatically. It's primarily a smart shell, and
interoperability with existing tools is a primary mission for it. (The
development team has been saying all along "don't fix what isn't broken").
In the case of tools like robocopy, it is probably more efficient to look at
simply resurfacing the tool in PS than actually replacing it wholesale or
immediately tweaking Copy-Item into a replacement.


"Lee Holmes [MSFT]" <lee.holmes@online.microsoft.com> wrote in message
news:e0HdMCeCHHA.3620@TK2MSFTNGP02.phx.gbl...
> Robocopy is a good utility for this.
>
> Once you start caring about file progress over a network connection, you
> start caring about a lot of other stuff, too.
>
> --
> Lee Holmes [MSFT]
> Windows PowerShell Development
> Microsoft Corporation
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
> "dreeschkind" <dreeschkind@discussions.microsoft.com> wrote in message
> news:C5F97A75-46E7-40CF-8573-84B0A0F57D02@microsoft.com...
>> This is a good idea.
>> "-writeprogress" could be an ubiq... I mean common cmdlet parameter for
>> all
>> cmdlets that might need some more time for processing (e.g. Move-Item).
>> If I
>> remember correctly, some of the Exchange Cmdlets for moving mailboxes
>> support
>> this out of the box. Would be nice to have this also in the Core cmdlets.
>>
>> --
>> greetings
>> dreeschkind
>>
>> "Rick Glos" wrote:
>>
>>> Hi,
>>>
>>> I was copying 1 large file to the network, a Virtual Hard Disk (4GB) to
>>> be exact, and was thinking it would be nice to see progress instead of
>>> it just sitting there and me looking at Process Explorer to make sure
>>> it's doing it.
>>>
>>> Has anyone done or seen this?
>>>
>>> I can't think of way with Copy-Item or xcopy unless using some kind of
>>> delegate method that checks file size...
>>>
>>> Perhaps using FileStream in combine with a Read() using a while loop?
>>>
>>> Any suggestions?
>>>
>>> Thanks,
>>> Rick
>>>
>>>

>
>



My System SpecsSystem Spec
Old 11-17-2006   #5 (permalink)
Rick Glos


 
 

Re: Write-Progess of Copy-Item

Sorry for the confusion and I hope I didn't lead anyone astray.

I was looking for a way to show progress when copying a large file.

I certainly wasn't advocating adding a new switch on existing cmdlets.

Which is why I posted, I'm sure someone here has copied a large file
using script... has anyone figured out an elegant way to show progress
as that file is being copied. If robocopy is the answer, cool. I've
actually never heard of it. I noticed I already have it, although I'm
not sure how it got there (WinXP SP2 - noticed some other developers
here do not have it). /shrug

On Nov 17, 6:05 am, "Alex K. Angelopoulos [MVP]" <a...@online.mvps.org>
wrote:
> Which reinforces the point that PowerShell should _not_ be treated as a
> "replacement" for anything automatically. It's primarily a smart shell, and
> interoperability with existing tools is a primary mission for it. (The
> development team has been saying all along "don't fix what isn't broken").
> In the case of tools like robocopy, it is probably more efficient to look at
> simply resurfacing the tool in PS than actually replacing it wholesale or
> immediately tweaking Copy-Item into a replacement.
>
> "Lee Holmes [MSFT]" <lee.hol...@online.microsoft.com> wrote in messagenews:e0HdMCeCHHA.3620@TK2MSFTNGP02.phx.gbl...
>
> > Robocopy is a good utility for this.

>
> > Once you start caring about file progress over a network connection, you
> > start caring about a lot of other stuff, too.

>
> > --
> > Lee Holmes [MSFT]
> > Windows PowerShell Development
> > Microsoft Corporation
> > This posting is provided "AS IS" with no warranties, and confers no
> > rights.

>
> > "dreeschkind" <dreeschk...@discussions.microsoft.com> wrote in message
> >news:C5F97A75-46E7-40CF-8573-84B0A0F57D02@microsoft.com...
> >> This is a good idea.
> >> "-writeprogress" could be an ubiq... I mean common cmdlet parameter for
> >> all
> >> cmdlets that might need some more time for processing (e.g. Move-Item).
> >> If I
> >> remember correctly, some of the Exchange Cmdlets for moving mailboxes
> >> support
> >> this out of the box. Would be nice to have this also in the Core cmdlets.

>
> >> --
> >> greetings
> >> dreeschkind

>
> >> "Rick Glos" wrote:

>
> >>> Hi,

>
> >>> I was copying 1 large file to the network, a Virtual Hard Disk (4GB) to
> >>> be exact, and was thinking it would be nice to see progress instead of
> >>> it just sitting there and me looking at Process Explorer to make sure
> >>> it's doing it.

>
> >>> Has anyone done or seen this?

>
> >>> I can't think of way with Copy-Item or xcopy unless using some kind of
> >>> delegate method that checks file size...

>
> >>> Perhaps using FileStream in combine with a Read() using a while loop?

>
> >>> Any suggestions?

>
> >>> Thanks,
> >>> Rick


My System SpecsSystem Spec
Old 11-17-2006   #6 (permalink)
Rick Glos


 
 

Re: Write-Progess of Copy-Item

ahh... Windows Resource Kit.

On Nov 17, 10:43 am, "Rick Glos" <rick.g...@gmail.com> wrote:
> Sorry for the confusion and I hope I didn't lead anyone astray.
>
> I was looking for a way to show progress when copying a large file.
>
> I certainly wasn't advocating adding a new switch on existing cmdlets.
>
> Which is why I posted, I'm sure someone here has copied a large file
> using script... has anyone figured out an elegant way to show progress
> as that file is being copied. If robocopy is the answer, cool. I've
> actually never heard of it. I noticed I already have it, although I'm
> not sure how it got there (WinXP SP2 - noticed some other developers
> here do not have it). /shrug
>
> On Nov 17, 6:05 am, "Alex K. Angelopoulos [MVP]" <a...@online.mvps.org>
> wrote:
>
> > Which reinforces the point that PowerShell should _not_ be treated as a
> > "replacement" for anything automatically. It's primarily a smart shell, and
> > interoperability with existing tools is a primary mission for it. (The
> > development team has been saying all along "don't fix what isn't broken").
> > In the case of tools like robocopy, it is probably more efficient to look at
> > simply resurfacing the tool in PS than actually replacing it wholesale or
> > immediately tweaking Copy-Item into a replacement.

>
> > "Lee Holmes [MSFT]" <lee.hol...@online.microsoft.com> wrote in messagenews:e0HdMCeCHHA.3620@TK2MSFTNGP02.phx.gbl...

>
> > > Robocopy is a good utility for this.

>
> > > Once you start caring about file progress over a network connection, you
> > > start caring about a lot of other stuff, too.

>
> > > --
> > > Lee Holmes [MSFT]
> > > Windows PowerShell Development
> > > Microsoft Corporation
> > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.

>
> > > "dreeschkind" <dreeschk...@discussions.microsoft.com> wrote in message
> > >news:C5F97A75-46E7-40CF-8573-84B0A0F57D02@microsoft.com...
> > >> This is a good idea.
> > >> "-writeprogress" could be an ubiq... I mean common cmdlet parameter for
> > >> all
> > >> cmdlets that might need some more time for processing (e.g. Move-Item).
> > >> If I
> > >> remember correctly, some of the Exchange Cmdlets for moving mailboxes
> > >> support
> > >> this out of the box. Would be nice to have this also in the Core cmdlets.

>
> > >> --
> > >> greetings
> > >> dreeschkind

>
> > >> "Rick Glos" wrote:

>
> > >>> Hi,

>
> > >>> I was copying 1 large file to the network, a Virtual Hard Disk (4GB) to
> > >>> be exact, and was thinking it would be nice to see progress instead of
> > >>> it just sitting there and me looking at Process Explorer to make sure
> > >>> it's doing it.

>
> > >>> Has anyone done or seen this?

>
> > >>> I can't think of way with Copy-Item or xcopy unless using some kind of
> > >>> delegate method that checks file size...

>
> > >>> Perhaps using FileStream in combine with a Read() using a while loop?

>
> > >>> Any suggestions?

>
> > >>> Thanks,
> > >>> Rick


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
copy-item over write help! PowerShell
Copy-Item : Container cannot be copied onto existing leaf item. PowerShell
Can the copy-item cmdlet be used to copy public folders to C: ? PowerShell
copy-item changing files attributes on network copy failures PowerShell
Getting Copy-Item to display messages (like the old COPY command in CMD.EXE) ?? 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