#63698 - 2002-03-08 10:33 AM
Progress bar while copying files
|
Anonymous
Anonymous
Unregistered
|
Hi all
I want to get a progress bar or something while i'm copying a file from a remote location to the local pc.
Anyone with an Idea how to manage this??
|
|
Top
|
|
|
|
#63700 - 2002-03-08 11:10 AM
Re: Progress bar while copying files
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11631
Loc: CA
|
Here is a UDF Arjen
UDF PBar() - Progress bar for DOS console
For use with KiXtart 4.02 PBar() - Progress bar for DOS console
|
|
Top
|
|
|
|
#63701 - 2002-03-08 01:55 PM
Re: Progress bar while copying files
|
Anonymous
Anonymous
Unregistered
|
Thnx all...
I fixed it with:
code:
$dir= dir("\\logonserver\netlogon\mcafee\datfile\*.zip") run '%comspec% /c copy \\logognserver\netlogon\mcafee\datfile\$dir c:\mcafee\datfile >>c:\mcafee.txt' $I= "." do $I $size1 = Getfilesize("\\logonserver\netlogon\mcafee\datfile\$dir") $size2 = GetFileSize("c:\mcafee\datfile\$dir") sleep 1 until $size1 = $size2
|
|
Top
|
|
|
|
#63702 - 2002-03-08 03:01 PM
Re: Progress bar while copying files
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
If you want to display the progress of a file copy, how about:
code:
$iSourceSize = Getfilesize($sSourceFile) $iDestinationSize=0 Run '%comspec% /c copy $sSourceFile $sDestinationFile >>c:\mcafee.txt' $iDestinationSize = GetFileSize($sDestinationFile) While $iDestinationSize < $iSourceSize Chr(13) "Copying - please wait: $iDestinationSize/$iSourceSize (" $iDestinationSize * 100 / $iSourceSize "%)" Sleep 1 $iDestinationSize = GetFileSize($sDestinationFile) Loop Chr(13) " " Chr(13)
Given $sSourceFile and $sDesinationFile it'll display a rising file count and a percentage.
|
|
Top
|
|
|
|
#63705 - 2002-03-20 08:23 PM
Re: Progress bar while copying files
|
Anonymous
Anonymous
Unregistered
|
If you've got unknown file sizes (and you're into visual basic) you might want to check out my gui status window for kix scripts. It's the source, so you'd need visual basic to compile it. If you're interested... http://www.nsss.net:81
|
|
Top
|
|
|
|
#63706 - 2002-03-21 12:23 AM
Re: Progress bar while copying files
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Indeed, morbid was definitely one of the early pioneers of the login script proggy-bar. But aside from the neat tools discussed so far, there are a few other ones out there. Here's one thats been around for a dogs age and that I'm particularly fond of. It's called loginscreen.exe and its avaliable from here:
Free COM objects and other tools for the script developer
If I was going to implement a login script progessbar, this would be on my short list. Its implemented as an ActiveX server application (.exe not a DLL). What this means is that the loginscreen window stays active and responsive to user input while your login script is executing. There are two seperate threads of execution, not just one as with a DLL snapin. Only problem is - its written in VB - which means it will fail on any workstation that doesn't have the VB runtimes installed (which may or may not be a problem for you) ... It also allows you to customize the window, display a bitmap, all that stuff, here's a VBS sample script of that:
'The following script illustrates how to use the methods and functions 'of the control. In order to use copy loginscreen.exe to a 'directory in your path Preferrably %windir% or %windir%\system32 'You should be able to run this script as is if you want to see how it 'works.
Set LoginBox = CreateObject("Loginscreen.Main") LoginBox.Start
LoginBox.SetTitle("Acme Widgets IT Services") LoginBox.Pbar(10) msgbox "okay"
Text = "Mapping 1st Drive" LoginBox.SetDisplayMessage(Text) LoginBox.Pbar(20) msgbox "okay"
Text = Text & vbcrlf & "Mapping 2nd Drive" LoginBox.SetDisplayMessage(Text) LoginBox.Pbar(35) msgbox "okay"
LoginBox.SetImage("c:\temp\paranet1.bmp") LoginBox.Pbar(45) msgbox "okay"
LoginBox.SetWelcomeMessage("Hey There!!") LoginBox.Pbar(60) msgbox "okay"
LoginBox.SetWaitMessage("Please be patient will you are being logged in.") LoginBox.Pbar(75) msgbox "okay"
LoginBox.NoImage LoginBox.Pbar(90) msgbox "okay"
LoginBox.NoDisplayMessage LoginBox.Pbar(100) msgbox "okay"
LoginBox.NoPBar msgbox "okay"
LoginBox.Kill Set LoginBox = nothing
-Shawn [ 21 March 2002, 02:22: Message edited by: Shawn ]
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 764 anonymous users online.
|
|
|