msgbox for progress

Is there a way to create a msgbox in a vbs script to show the progress of a action.

For example:

If I had something in the such as copying a very large file somewhere that would take 5 or 10 minutes, can a msgbox come up while it is working, then close and continue. Don't want a box to come up where you have to click OK to close it and continue.

Thanks,

bt707Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobSampsonCommented:
Hi, this should do it.  It shows the standard windows progress bar:
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_23213819.html

Regards,

Rob.
0
bt707Author Commented:
Hi Rob,

I tried that but did not work, getting a error path not found for some reason, I have the correct paths in and full rights to those directories. Do you have any idea why I would get a path not found error, it's coming from this line.
Set objSourceFolder = objFSO.GetFolder(strSourceFolder)

Here is what I tried

'=========================
strSourceFolder = Replace(WScript.ScriptFullName, WScript.ScriptName, "") & "D:\temp\test"
strTargetFolder = Replace(WScript.ScriptFullName, WScript.ScriptName, "") & "D:\temp\test2"
 
If Right(strSourceFolder, 1) <> "\" Then
        strSourceFolder = strSourceFolder & "\"
End If
If Right(strTargetFolder, 1) <> "\" Then
        strTargetFolder = strTargetFolder & "\"
End If
 
Const FOF_CREATEPROGRESSDLG = &H10&
Set objFSO = CreateObject("Scripting.FileSystemObject")
 
Set objSourceFolder = objFSO.GetFolder(strSourceFolder)
Set objShell = CreateObject("Shell.Application")
Set objTargetFolder = objShell.NameSpace(strTargetFolder)
If Not objTargetFolder Is Nothing Then
        'MsgBox "Copying " & objSourceFolder.Path & " to " & strTargetFolder
       
        objTargetFolder.CopyHere objSourceFolder.Path, FOF_CREATEPROGRESSDLG
Else
        MsgBox "There was an error finding " & strTargetFolder
End If
MsgBox "Done"
'==================


Thanks,
0
RobSampsonCommented:
Hmmm, no not really....above that line
Set objSourceFolder = objFSO.GetFolder(strSourceFolder)

put this
strSourceFolder = InputBox("Source folder is:", "Source Folder", strSourceFolder)

and then see if you can copy and paste that path to a Windows --> Run box and find it....

Regards,

Rob.
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

bt707Author Commented:
That is the problem, probably a easy one for you but I'm not sure what to fix.

The box give me this for the path.

Source folder is:
D:\TEMP\D:\temp\test\

Thanks,


0
RobSampsonCommented:
Oh yeah!  I see what the problem is....

You have this:
strSourceFolder = Replace(WScript.ScriptFullName, WScript.ScriptName, "") & "D:\temp\test"

but the problem there is that this part
strSourceFolder = Replace(WScript.ScriptFullName, WScript.ScriptName, "")

returns the current folder that the script is running from.

Remove those and use just this:
strSourceFolder = "D:\temp\test"
strTargetFolder = "D:\temp\test2"

Regards,

Rob.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bt707Author Commented:
OK, I see now. That fixed it. Learned a few new things here.
Works very well now.

Thank you very much.
0
RobSampsonCommented:
No problem at all. Thanks for the grade.

Regards,

Rob.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.