All Forums >> [Scripting] >> Post a VBScript >> Dynamic Activity Window Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Code updated: July 4, 2006 Comments updated: July 18, 2006 This is my HTA-based progress bar. There are many like it, but this one is mine. My HTA-based progress bar is my best fri... oh sorry, Full Metal Jacket flashback. heh heh In any case, I've updated it with a bunch of private subs to make the main codebase a little cleaner. Minor tweaks for performance and stability to overcome the issues when running very long scripts the progressbar bombs out. Also, the class is completely self-contained now, so there no additional functions that need to be utilized. Enjoy! **NOTE: The HTA version uses WMI to get a list of the running processes, so will be unstable/unusable on Win9x & WinNT4.0 even with the WMI addon installed. Users needing a progressbar to run on those OS's should use the IE-based bar located at http://www.visualbasicscript.com/m_31631/tm.htm. ===============
I shamelessly stole the beginnings of this code from http://www.visualbasicscript.com/fb.aspx?m=31585. I then beat it with a hammer, beat myself with a soup spoon and came up with this little gem It's a class that pops up an HTA window to show the user that something is going on, and allows you to change the text in the window to match what you are doing. The code below contains the class itself, and about 8 lines of code to demonstrate it's use. All you have to do is paste it into a .vbs file and run the .vbs. You should see something like the screenshot I am posting. To modify the colors, change the text on lines 151,152: oBarCat.Add oBarCat.Count, "body,td,a {font-family:Arial;font-size:12px;text-decoration:none;color:black;}" oBarCat.Add oBarCat.Count, "body {filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#9999FF', EndColorStr='#FFFFFF')}"
it doesn't do anything ;-) its a bit code that i used to change the Title of the Window dynamically and you deleted the dynamical thing of it (the strVer Value) ...
I know that an IE object being opened from a vbs is able to be updated, but I am not so sure about an hta. From what I gathered on the net, writing a file and having the hta pick out the data was the only way to get the job done.
As I am admittedly weak when it comes to html or hta design, etc. I will let others make any modifications to the code they see fit, rather than trying to 'perfect' the html. heh heh
And thanks for the original code, btw!
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers)
"It is better to die like a tiger, than to live like a pussy." -Master Wong, from Balls of Fury
Hey there. I am trying to implement this class in my printer installing code, and for some reason it is coflicting with the WshShell '**************Load Prnadmin.dll***************** Set WshShell = Wscript.CreateObject("Wscript.Shell") WshShell.Run "regsvr32 Prnadmin.dll /s",1,TRUE '*****************************************************
Is there anything else in the implementaion I should know about??
Hey there. I am trying to implement this class in my printer installing code, and for some reason it is coflicting with the WshShell '**************Load Prnadmin.dll***************** Set WshShell = Wscript.CreateObject("Wscript.Shell") WshShell.Run "regsvr32 Prnadmin.dll /s",1,TRUE '*****************************************************
What kind of conflict are you getting? I don't use anything named WshShell in my code, so unless you changed something, it shouldn't be conflicting with anything. From what code you posted, it looks like yer just registering a .dll file, but I don't see where that would affect anything else in the script. The best thing that you could do, would be to take ebgrren's advice, and post the entire code that you are trying to run, along with an explanation of the errors you are receiving.
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers)
"It is better to die like a tiger, than to live like a pussy." -Master Wong, from Balls of Fury
Here is my whole code. The conflicts appears depending on which I put first. If I put the Option explicit first it won't execute the wShell and viceversa. No matter what, it allways ends up in a endless loop. Here's the code.
< Message edited by Snipah -- 4/6/2006 2:03:33 AM >
So my antyspyware kept detecting it and creating a delay that would throw it into the loop. Now it's working perfectly. Thanx so much for the help, I really appreciate it, and it's been very useful