Solved

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

Posted on 2011-02-15
4
407 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
  • 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now