Solved

I need a vbscript that can show a progress bar when copying a folder

Posted on 2011-02-15
4
414 Views
Last Modified: 2012-06-21
When the copy is complete , the progress bar should dissapear.
How can I impliment this ?
0
Comment
Question by:itbabe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 11

Expert Comment

by:Tasmant
ID: 34895505
VBScript and progress bar are a pain.
You could do better and easier with Powershell and the cmdlet write-progress
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 34895635
You can use the progress bar when copying a file with this code.

Regards,

Rob.
strFile = "C:\Temp\MyFile.txt"
strDestination = "C:\Temp\DestinationFolder"
Const FOF_CREATEPROGRESSDLG = &H10&
Set objShell = CreateObject("Shell.Application")
Set objTargetFolder = objShell.NameSpace(strDestination)
If Not objTargetFolder Is Nothing Then
	objTargetFolder.CopyHere strFile, FOF_CREATEPROGRESSDLG
End If

Open in new window

0
 

Author Comment

by:itbabe
ID: 34896271
Can I also disable the cancel button ?
0
 
LVL 65

Assisted Solution

by:RobSampson
RobSampson earned 500 total points
ID: 34900777
Not that I know of.  It's a system dialog, which you cannot customise.

I haven't tested it, but maybe try changing this:
Const FOF_CREATEPROGRESSDLG = &H10&

to this
Const FOF_CREATEPROGRESSDLG = &H110&

Regards,

Rob.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question