Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progress bar

Status
Not open for further replies.

omegabeta

Programmer
Aug 20, 2003
148
0
0
RO

I have a script that make a copy of some files(32 MB). How can I display a progress bar or activate the MS form corresponding to the copy operation ?

Thanks in advance.

 
Try something like this:
Code:
srcfile="\path\to\bigfile"
destdir="\\server\share\path\to\dir"
Set SA=CreateObject("Shell.Application")
Set NS=SA.NameSpace(destdir)
NS.CopyHere srcfile,16

Hope This Help
PH.
 
Here is a VBScript solution for you. It is really just a fake bar, but it let's your user know something is happening.

set x = createobject("internetexplorer.application")
'in code, the colon acts as a line feed
x.navigate2 "about:blank" : x.width = 350 : x.height = 80 : x.toolbar = false : x.menubar = false : x.statusbar = false : x.visible = true

x.document.write &quot;<font color=blue>&quot;
for n = 1 to 100
x.document.write &quot;|&quot;
wscript.sleep 50
x.document.title = n & &quot; %&quot;
next
'close the window
x.quit
set x = nothing
 
to markdmac,

I've egt the following error message:
Object doesn't support this property or method: 'WScript.Sleep'

What can I do to avoid that ?
 
I use WinNT. In WSH's help I've read Version 4.00 5000
Another solution?

Thanks
 
omegabeta, have you tried the solution I posted ?
 
Dim Network,shell,fso,ParentFolder,objFolder,objShell
Const FOF_CREATEPROGRESSDLG = &H0&
Set Network=WScript.CreateObject(&quot;Wscript.Network&quot;)
Set fso=WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set shell=WScript.CreateObject(&quot;Wscript.Shell&quot;)
Network.MapNetworkDrive &quot;W:&quot;, &quot;\\server1\share$&quot;
ParentFolder=&quot;W:\AWBS&quot;
Set objShell=WScript.CreateObject(&quot;Wscript.Shell&quot;)
set shell=CreateObject(&quot;Shell.Application&quot;)
set objFolder=shell.NameSpace(ParentFolder)
objFolder.CopyHere &quot;C:\Folder\*.*&quot;_ ,FOF_CREATEPROGRESSDLG
Network.RemoveNetworkDrive &quot;W:&quot;
 
Dim Network,shell,fso,ParentFolder,objFolder,objShell
Const FOF_CREATEPROGRESSDLG = &H0&
Set Network=WScript.CreateObject(&quot;Wscript.Network&quot;)
Set fso=WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set shell=WScript.CreateObject(&quot;Wscript.Shell&quot;)
Network.MapNetworkDrive &quot;W:&quot;, &quot;\\server1\share$&quot;
ParentFolder=&quot;W:\AWBS&quot;
Set objShell=WScript.CreateObject(&quot;Wscript.Shell&quot;)
set shell=CreateObject(&quot;Shell.Application&quot;)
set objFolder=shell.NameSpace(ParentFolder)
objFolder.CopyHere &quot;C:\Folder\*.*&quot;, FOF_CREATEPROGRESSDLG
Network.RemoveNetworkDrive &quot;W:&quot;
 
To PHV & TheKidd

I've got th efollowing error message:
ActiveX component can't create object: 'Shell.Application'

What can I do ?
 
Simply install Internet Explorer 6.0 SP1, I guess.
Anyway your ScriptEngine will upgrade to 5.6.

Hope This Help
PH.
 
I assume &quot;WinNT&quot; means NT 4.0 rather than NT 5.0 (Win 2000) or NT 5.1 (Win XP). This may explain some of the trouble, along with a possible need for the WSH 5.6 update [italics below are mine]:

&quot;Many of the Shell objects became available in version 4.71 of the Shell. Others are available in version 5.00 and later. This means that on computers running Windows 95 or Microsoft Windows NT® 4.0, the Shell objects are available only if the integrated desktop is installed. Version 4.71 of the Shell is on all Windows 98 computers, and version 5.00 is on all Windows 2000 computers.&quot;

Link:

The desktop update was only directly made available through the IE 4.x installation, though I know it can be done with IE 5.x's installer if you use Internet Explorer Administration Kit (IEAK) versions of the installer package. The problem is, these can be hard to obtain. I don't think IEAK 5 is available any longer, and I don't know if IEAK 6 contains the desktop update components.

Plus, IEAK requires registration and (free) licensing:


The setup command-line parameters needed are tricky and finicky as well. I don't recommend this route.


The best thing to do might be to locate a regular IE 4.01 (or later IE 4.x) installation package on an old CD or something. Then remove any newer version of IE, install IE 4 and answer Yes when prompted for the desktop update, and finally reinstall a later IE over it.

Sometimes you can find the IE 4.x package on things like Office 2000 CDs (maybe Office 97?) or even old MSN, AT&T, or AOL CDs! Of course the latter may give you a &quot;branded&quot; version of IE on your machine. I keep an old MSN CD around just for reinstalling NT 4.0 when necessary, so I have IE 4.x on hand to complete the job. If you have the TechNet CDs you might find IE 4.x there too, though you might need a really old set.

There was a lot of FUD and other propaganda from the anti-Microsoft camp about IE's place in the Windows operating system around the time of IE 4.x, and it led a lot of people astray. It is also true that Microsoft recommended that when using NT 4.0 Server as a web server you should install IE 4.x but not the desktop update. This seemed to confuse people into avoiding the desktop update for NT 4.0 Workstation as well.


Lots of work for a progress bar. Another good reason to keep machines properly &quot;up to date&quot; though. Maybe one of the other suggestions will work for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top