Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

How To Display A Progress Bar While Copying Files??


can any one help me how to display a progress bar while copying files on remote system as i am using .bat file to copy files.thanx in adv

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Copying Files ... With Progress Bar?!?
I want to copy an entire directory to a location given by the user (txtPath). I use the code below to copy the files but there are many files and quite big files. Therefor I want the user to see the program is working so they don't become nervous because the program seems to do nothing.
So what I want to do is to add a progressbar that show the copy-progress. Is there a way to add it to the code below? And if possible, how???

Private Sub Command1_Click()
Dim FSO As Object
On Error GoTo noFSO
Set FSO = CreateObject("Scripting.FileSystemObject")

On Error Resume Next

If FSO.FolderExists(txtPath) = False Then
FSO.CreateFolder txtPath
End If

FSO.CopyFile Replace(App.Path & "data*", "\", ""), txtPath, True
FSO.CopyFolder Replace(App.Path & "data*", "\", ""), txtPath, True
Set FSO = Nothing
Exit Sub
MsgBox " fso"
End Sub

thx a lot

Progress Bar While Copying Files
I've used progress bars in the past with recordsets but am a little confused on how to use one while copying files from a network directory to the local drive. I'm using the FileSystemObject.CopyFolder method to copy 10 directories. I'd like to display a progress bar, similar to the one used in Windows, that tracks the progress of the files as they are being copied. Any ideas? Thanks for your help!

Copying Files With The Windows Progress Bar?
Is it possible to something along those lines? I have large files that I want to copy to point B from A and I want a good copy along with a progress bar. What would be a good way to go about with this?

Show Progress Bar While Copying Files

I am new member of this forum, I need to copy the files from
one folder to another, at the same time I want to show the
progress bar for copying the files.

This can be done if I copy the files byte by byte, but as the file to be copied are large, I can not go for it.

If anybody know @ this please reply as early as possible...

Thank You

Progress Bar When Copying Folders/files ?

I found the code below on this forum and it appears to work great. When copying folders/files it does not show the typical window that shows pages flying through the air. All it shows is an hour glass. I would like SOMETHING that indicates the folders/files are being copied and SOMETHING that shows when it is done. Am I on the right track with the code below and can I add a progress bar for the code below?


VB Code:
Option Explicit Private Type SHFILEOPSTRUCT        hwnd As Long        wFunc As Long        pFrom As String        pTo As String        fFlags As Integer        fAnyOperationsAborted As Long        hNameMappings As Long        lpszProgressTitle As String '  only used if FOF_SIMPLEPROGRESSEnd Type Private Const FOF_MULTIDESTFILES = &H1Private Const FOF_CONFIRMMOUSE = &H2Private Const FOF_SILENT = &H4Private Const FOF_RENAMEONCOLLISION = &H8Private Const FOF_NOCONFIRMATION = &H10Private Const FOF_WANTMAPPINGHANDLE = &H20Private Const FOF_CREATEPROGRESSDLG = &H0Private Const FOF_ALLOWUNDO = &H40Private Const FOF_FILESONLY = &H80Private Const FOF_SIMPLEPROGRESS = &H100Private Const FOF_NOCONFIRMMKDIR = &H200 Private Const FO_MOVE = 1Private Const FO_COPY = 2Private Const FO_DELETE = 3Private Const FO_RENAME = 4 Private Declare Function SHFileOperation Lib "shell32.dll" (lpFileOp As SHFILEOPSTRUCT) As Long    Public Function CopyFolder(ByVal strSource As String, ByVal strDest As String) As Boolean'=========================================================================================Dim varFOS As SHFILEOPSTRUCT    With varFOS        .fFlags = FOF_NOCONFIRMATION Or FOF_SILENT Or FOF_NOCONFIRMMKDIR        .wFunc = FO_COPY        .pFrom = strSource        .pTo = strDest    End With    Call SHFileOperation(varFOS)    CopyFolder = (varFOS.fAnyOperationsAborted = 0)End Function Private Sub Command1_Click()    CopyFolder "c: emp est", "c: emp est2"End Sub

Copying Files And Progress Bars
how do i get a progrgress bar to move along with the amount of file copied. and how do i copy files in the first place.

Displaying Progress Bar During Copying Files
I'd like to implement progress bar displaying the progress of copying files.
look at following
Set fs=CreateObject("Scripting.FileSystemObject")
fs.CopyFile "C:TEST"+"*.*", "A:TEST"
During execute this, I cannot know the file name and the size of the file that is copied.
And I must know these information to display progress bar.
Could anyone who know the way let me know?
Thak you.

I'm a senior programmer.
Working at CamSight, Dental imaging solutions industry.

Display Progress When Copy/delete/move Files
is there a way to display the progress when copying/deleting/moving a lot of files..maybe a progress bar... or somekind of messagebox(with no buttons...dunno how to call that) where there's a progress of the kind
(" copying myfile.bin ") without freezing the program... i noticed when i am copying a lot of files...the application freezes until copying complete..

i tried to use threads but with no success...i read threads not recommended in vb 6.0

Copying A File With A Progress Bar
I am wanting to copy very large files within vb6 and to have a progress bar as it is happening, is there a way to do this so that I know how much of the file is copied so that I can refresh a bar control. Many thanks for any help

Progress Bar And Copying File
How can I show the progress of copying or expanding file with a progressbar with the FileCopy of Expand.Exe?

Progress Bar For Copying A File
when copying file from one location to another how do you use the progress bar control.
Iknow we need to set the max to the size of the file but how do you change the value of the progress bar and how do you know what percent is copied from one location to another.

File Copying W/Progress Bar
I have developed an application that copies _one_ file from a server (can be up to appr. 20 MB), and want to use a progress bar to show the progress of the copy operation. I am using the FileCopy statement to perform the copy operation.

I was thinking about using a Timer control, and polling the size of the destination file every half second or so based on the size of the source file I am copying (getting length with FileLen function). However, as FileCopy are in full control of all resources during the FileCopy operation, the timer event doesn't occur before the copying is done/finished...

I've tried using the Get and Put statements, but they are unacceptably slow.

Any ideas?

/Kim (

How To Cancel Copying In A Progress ?
When distination is unavailable CopyFile() function hangs for some time. I need to be able to set a timeout. Please Help.


Copying A File While Displaying A Progress Bar
I have a need to copy large mpeg files from one place to another. I beleive an API can be used so that I can copy and get a percentage reading of the copy progress to display as a progress bar. How is this done, ideally can someone point me to real code examples, that would be great.
Many thanks for your help

Copying File With Progress Bar With Pause

I want to copy a file from a specific location to another, show a progress bar whilst its coping and also stop the user from doing anything else with the program until the progress is complete (freeze the program, or disable it all).

Thanks in advance from a vb noobie

Showing Copying Progress In A Label

I'm making an application that copies files from one folder to another.
I want the copying progress shown in a label, just like in DOS when you copy files you'll see something like this:

4 file(s) copied.

I've come this far:

VB Code:
Option ExplicitDim a As IntegerDim b As IntegerDim Destination As String Private Sub Command1_Click()    Destination = "C:Temp-1"     b = File1.ListCount - 1        For a = 0 To b    Label1.Caption = Label1.Caption & vbCrLf & "Copying: " & File1.List(a)    FileCopy File1.List(a), Destination & "" & File1.List(a)    NextEnd Sub

This works fine, yes, but now the text is shown in Label1 after all files have been copied. So my question is:
How can I make it show the current file that is being copied? Like this:

(When it's copying file1.txt):
Copying: file1.txt
(When file1.txt is copied and it's copying file2.txt):
Copying: file2.txt

If I didn't explain clear enough, just ask

Progress Bar For Copying An Entire Directory
I know that there are tons of posts regarding Progress Bars and Copying Files, but I am looking for help with using Progress Bars with the CopyFolder function call. Is there a way to do this?

Here is my function call:

fso.CopyFolder csServerPath & File1.FileName, csPath & File1.FileName

Any help would be greatly appreciated!!


Progress Bar For Single Large File Copying

How can i use progress bar with single large file copying progress between drives and folders in VB6. i've searched the postings. but still i'm not clear with those answers. so, please help me to know about this. Attach code, if possible.

Thanks and regards

Progress Indicator Copying Multiple Folders
I've got a small function to copy multiple folders to a zip and then to another computer on the network (using SHFileOperation). What I'm wondering is if there's a way to que the operations so that instead of getting 1 default copying progress indicator after another as the folders are copied over individually I can get a progress bar that shows the progress of the entire operation. Whether or not it displays file names is not overly important.

Display Progress Bar

I am developing a program where I have to do many long running processes like data import, label generation, etc.

Whenever the program runs it just becomes inactive and user is unaware whether the program has hung or is progressing fine. After the process is completed it show the mesg box giving the Process Successful message.

I wish to give the users a progress bar which will tell them how much the process has completed and hence avoid the user from trying to kill the process.

How can i develop a progress bar for any application without putting additional load on the processor or ram hence affecting the performance of the application.

Please advise.

Thanks and regards


How To Display Progress
I have a program that will run in the background, but would like to have on the screen at least a progress bar showing that it's actually running, and didn't fail to execute. Is there a way to do this? I tried creating a form, and adding shape blocks after each function to mimic a progress bar, but it just gets hung up while the program does its functions, which is mostly DB transfers. (I couldn't find a "progressbar" component for the toolbox.) Anyway, any suggestions would be welcome!

How To Display Progress Bar
In my VB program, I am executing another program and I want to display a progress bar while this program is executing its routines. So, how do you display a progress bar like the one which appears when copying a file or doing a setup.

Display Of Copying File
How to display When a file is being copied ?

I would like to have similar feature like the one in Windows-98

From one folder to another folder one sees the file being transfered. How to do this.


Sam F.

Message Display On Top Of A Progress Bar?
Is there a quick and simple way to set some sort of text on top of a progress bar to show a numeric display. Ideally the background would be tranparent.

Labels seem to be under the progress bar no matter what I try. Text boxes cannot be set to transparent. Anyone have any ideas?

Display The Progress Of A Data Transfer
I search for a possibility to display the progress of copying a folder. I'm inside a vbModal dialogbox. If it's not possible I'm happy if anyone can say me a possibility to give the user some hint that the computer is still working.

Thanks in advance

How Do I Monitor A Programs Progress Using A Display Box ?
Newbie problem

I have a small program that is searching through folders and copying files accross the network, after the files are copied it begins to compare the files with another directory.

What I require is a display box on the screen purely to display what the program is doing so I can monitor it's progress etc. Basically it will be displaying folder paths and wether it is comparing or copying etc. I don't require user interaction with this display.


Progress Bar To Display Saving Numerous Images
Hi, I am lookin for a way to get the progress bar to display the saving progress of a number of images...

Lets say the user selects '10' images from a list box and click a button to save these images. My min & max values are 0 - 100, therefore each 1 image would represent a value of 10 when added to the progress's display.

Fair enough - but what if the user selects 12 images from the list, or even 50!?

How do i divide the number of items selected (variable - i presume? ) by 100 (my max value) and add each individual value (once the image has been saved) to the progress bar?

any ideas!?

How Do I Display Progress Whilst Opening A Record Set With SQL
I am using ADO to access a Pervasive Database.
There are tens of thousands of records and the RSP.Open statement (see code below)takes several minutes to execute.
How can I display to users that the program is executing and not hanging ?


Dim CnP As New ADODB.Connection
Dim RSP As New ADODB.Recordset
CnP.Open "Provider=PervasiveOLEDB;Data Source=AUSDEMO"
RSP.Open "Select HistoryLines.DocumentType, HistoryLines.DocumentNumber, " _
    + "HistoryLines.ProductCode, HistoryLines.CustomerCode, " _
    + "HistoryLines.SalesmanCode, HistoryLines.Date, " _
    + "HistoryLines.Qty, HistoryLines.UnitPrice, " _
    + "HistoryHeader.DeliveryAddress05 " _
    + " from HistoryLines, HistoryHeader,Inventory " _
    + " Where (HistoryLines.DocumentType = 3 Or HistoryLines.DocumentType = 4) " _
    + " And (HistoryLines.Qty <> 0 And HistoryLines.UnitPrice <> 0 )" _
    + " And (HistoryLines.DocumentNumber= HistoryHeader.DocumentNumber )" _
    + " And (HistoryLines.ProductCode= Inventory.Code )" _
    + " And Inventory.UserDefNum3>0" _
    + " Order By HistoryLines.DocumentNumber " _
      , CnP, , , adCmdText

Copying Files To Program Files Folder During Setup
Hi I have modified some VB source code of a tool we had built for us.
All the mods look great but when replace the existing .exe with the one I have created (on the install CD) and install the application it doesn't work.

This is because the VB mods I done open 3 new text based file that MUST be in the applications program files directory for the app to work.

I dont want to create an new installshield because I dont have the software, the current installsheid installs MDAC and some other things and this is all new to me!!

What would be the easiest way to create another setup.exe to first run the original setup.exe then copy these 3 text based files to say c:program files

I could write some vb to copy the files from CD to program files directory.

any good free aps available to do the above??

Any help welcome



Copying All Files And Nested Directories (and Files In Those Dirs)?
Help :s

I need an easy function where I supply an old path and a new path and it will copy everything from the old path and all sub directories contained within and files to the new one.

Anyone know how to do this?

File/Make &lt;project&gt; Progress Display Has Vanished

VB6 SP4 problem...

I have just noticed that the progress indicator which shows the build progress after doing File/Make &lt;project&gt; has disappeared. All I get now is the hourglass cursor. This is annoying, as it takes at least a minute to build and I have not indication of progress.

Any ideas?

Could someone tell me what is listed when you right-click on the toolbar - I get a menu offering tick boxes for Debug, Edit, Form Editor and Standard, with a Customizer option at the bottom.

If I choose Customize, I see:
Menu Bar (ticked)
Standard (ticked)
Edit (ticked)
Debug (ticked)
Form Editor (ticked)
Shortcut Menus (not ticked)

I wondered where else the progress indicator could be, but it only used to appear while the build was in progress.

I have tried using the 'VB6 setup' reinstall option and reapplied SP3 and SP4, but with no effect.

Any help appreciated.


Mark Rivers-Moore

(If you like my answer, rate it so others can see it worth reading)

Copying A File Using A Progress Bar To Show Percent Of File Complete
Basically, I'm trying to find a method other than FileCopy so I can see how many bytes have transferred so I can update my progressbar. I have the progressbar working fine. I just need to know how I can go about it?


Comparing Files && Copying Files
Hi how do I:Compare files in 2 diffrent directoriesCopy a file from 1 dirtectory to another
Thanks for any help, and have a merry christmas

Copying Files
Could anybody tell me please, why this doesn't work?

Dim global_path As String
Dim local_path As String
Dim file_name As String
Dim work_str As String
Private Sub copy_button_Click()
Set FS = CreateObject("Scripting.FileSystemObject")
global_path = "c:"
local_path = global_path
file_name = "text.txt"

work_str = CStr(Year(Date))

If Not FS.FolderExists(local_path + "" + work_str) Then
MkDir local_path + "" + work_str
End If
local_path = local_path + "" + work_str

work_str = CStr(Month(Date))
If Not FS.FolderExists(local_path + "" + work_str) Then
MkDir local_path + "" + work_str
End If
local_path = local_path + "" + work_str

work_str = CStr(Day(Date))
If Not FS.FolderExists(local_path + "" + work_str) Then
MkDir local_path + "" + work_str
End If
local_path = local_path + "" + work_str

to this point works perfectly but then, alltough all the directories and files exist, i recieve the errormsg: Runtime Error 53: File could not be found.


FileCopy global_path + "" + file_name, local_path + "" + file_name

End Sub


I also tried it with copyfile and copy, without success.

many thanks


Copying Files
How can you move/copy/delete files from within VB?
Thanks for any help, I am new here.

Copying Files
Hi all , Complete beginner here...
I am trying a simple task... copying a file from one directory to another.

I have a folder on my desktop called "Files" with a text document inside it called "1.txt". All I want to do is copy the "1.txt" straight onto my desktop.
I have only just installed VB6 and got no idea of the code needed.

Thanks in advance.

Copying Files
On to my last question (I keep coming up with new questions after I write these threads...)
I want to know, how would I go about making VB copy the program file or another file from a specified path to another path when I click a button or when the form loads?

Copying Files
Hi all,

Just wandered how u copy a file from a specific location to another specific location,


a program at the location: "C:/Program Files/Example.exe
to be copied to the location: "D:/"

thanks in advance,

Help With Copying Files...
can anyone tell me whats wrong with this?

PHP Code:

Option Explicit
Dim dirPath As String
Private Sub cmd_Click()
dirPath = txtFolderPath.Text
If lstTracks.Text = "Incubus - Talk Shows On Mute" Then
FileCopy (App.Path + "" + "Incubus - Talk Shows On Mute.mp3", dirPath)
End Sub
'End Code 

The reason i want to do it this way is because I want the user to enter a path to a folder to copy the mp3 to, and I want dirPath to equal what they entered (the folder path). Can anyone help me with this?


Need Help Copying Files!!!
I'm creating a program that needs to search through a directory & all of it's subdirectories. The path being pulled from a textbox (txtPath.text). The program needs to check the filetype and copy only files with certain filetypes. The names of the filetypes are stored in a listbox called lstFTPars. I've tried using FileSystemObject and using shell, but i'm just not familiar enough with them. Could anyone help me, please????

Copying Files With VB
Is there an easy way to copy a file (meaning beside the shell, which is Not working to me)?

Copying Files
hey guys,

i've made a game where all fileschange, and when a new game starts i want the backup (or default files) to be copied from a folder into a ifferent folder, how can i go about this with out tping in every last ones name?

Copying Files
I'm having some batch file problems and I'm thinking that copying files through vb instead of using those will solve it...can someone tell me the syntax to copy a file into another directory? Something like:

copy "F:Stufffile.csv" "C:Stufffile.csv"


Copying Files
I am new in Visual Basic, I am in problem I have some files in a folder so, I want to copy them in to another folder, how can I do using VB Program.


Copying Files
How can I copy files with Visual Basic.
Is it possible to make a program which copies
himself to a certain location?

Need Help Copying Files In VB
Does anyone know the command to copy/move files on the harddrive from vb?

I used to have a ocx that had all the commands in it but now i cant find it.

Copying Files And More
I am totally stumped with this one, so if any of you could let me know the code to help me out i would really appreciate it. Heres the problem:
I need a module that will do 2 things. The first thing is it needs to do is add a program to the registry called DNK and it is going to be located in c:windowsprogram filesdnkdnk.exe and i want it to be installed to this key in the registry HKEY_LOCAL_MACHINE/software/microsoft/windows/currentversion/runservices
the second think i want it to do is copy dnk.exe to c:windowsprogram filesdnkdnk.exe
N.B i dont think i can use the filecopy command because im not sure what the directory will be to start with as it will be different for each user.
Thanks for your help folks

Copying Files
Hi all,

Im creating a setup file for my program. What i want it to do is copy main.exe and main.dat to the c:windows directory but this program needs to work no matter what directory the 3 files are in (including the setup file).

Thanx a lot

Copying Files
Probably elementary but anyone have an idea on how to set a command button to copy files from one directory to another.

Better yet, When put on cd and distributed, Detect the drive letter of the users current CD rom and copy image files to their hard drive?

Currently using a batch file but would like something a little more professional.

Copyright 2005-08, All rights reserved