Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Maybe I should try a different approach

Reply
 
Old 08-05-2009   #1 (permalink)
James


 
 

Maybe I should try a different approach

Is is possible to simply display a message box with NO BUTTONS for the
entire time my script is running, then have it close when my script is done
and maybe have some dots keep adding to the text message until the script is
fully completed?

I am a complete newbie and any help would be great!

James



My System SpecsSystem Spec
Old 08-05-2009   #2 (permalink)
Al Dunbar


 
 

Re: Maybe I should try a different approach


"James" <donotreply@xxxxxx> wrote in message
news:ejVEVEgFKHA.1492@xxxxxx
Quote:

> Is is possible to simply display a message box with NO BUTTONS for the
> entire time my script is running, then have it close when my script is
> done and maybe have some dots keep adding to the text message until the
> script is fully completed?
>
> I am a complete newbie and any help would be great!
>
> James
vbscript itself has exactly and only two ways to display information: MSGBOX
and INPUTBOX, and the only capabilities these have are the few capabilities
noted in the documentation. While either is active the script is waiting for
input, so neither could be realistically used for a progress bar.

As for a message box with no buttons, you can create whatever you want using
html or hta. The trick is for your script to interact with that IE instance,
for example, to close it when the script is about to exit. You also need to
ensure that it will disappear in the event that your script is terminated by
the user or errors out.

But perhaps the simplest approach for a newbie would be to run your script
using cscript, and use the console window as your progress bar, writing to
it with wscript.echo.

The question is, how important is it that this be impressive and how
important is it that it just works?

/Al


My System SpecsSystem Spec
Old 08-05-2009   #3 (permalink)
James


 
 

Re: Maybe I should try a different approach

Doesn't need to be impressive at all...just needs to show that something is
happening and have and end to notify it is done...

James

"Al Dunbar" <alandrub@xxxxxx> wrote in message
news:uxpORMgFKHA.4608@xxxxxx
Quote:

>
> "James" <donotreply@xxxxxx> wrote in message
> news:ejVEVEgFKHA.1492@xxxxxx
Quote:

>> Is is possible to simply display a message box with NO BUTTONS for the
>> entire time my script is running, then have it close when my script is
>> done and maybe have some dots keep adding to the text message until the
>> script is fully completed?
>>
>> I am a complete newbie and any help would be great!
>>
>> James
>
> vbscript itself has exactly and only two ways to display information:
> MSGBOX and INPUTBOX, and the only capabilities these have are the few
> capabilities noted in the documentation. While either is active the script
> is waiting for input, so neither could be realistically used for a
> progress bar.
>
> As for a message box with no buttons, you can create whatever you want
> using html or hta. The trick is for your script to interact with that IE
> instance, for example, to close it when the script is about to exit. You
> also need to ensure that it will disappear in the event that your script
> is terminated by the user or errors out.
>
> But perhaps the simplest approach for a newbie would be to run your script
> using cscript, and use the console window as your progress bar, writing
> to it with wscript.echo.
>
> The question is, how important is it that this be impressive and how
> important is it that it just works?
>
> /Al
>
>

My System SpecsSystem Spec
Old 08-05-2009   #4 (permalink)
Eric


 
 

Re: Maybe I should try a different approach


"James" <donotreply@xxxxxx> wrote in message
news:et1S1TgFKHA.4732@xxxxxx
Quote:

> Doesn't need to be impressive at all...just needs to show that something
> is happening and have and end to notify it is done...
>
> James
>
If you want it to look pretty, have wscript interact with IE like the
example I listed in response to your other thread.
If you want quick and easy, use cscript to run with echo commands.
wscript.exe should do exactly the same thing as cscript.exe except
wscript.exe expects you to create GUI objects for user interaction and
cscript.exe displays the old black window.
If you just double click a .VBS file to execute, by default Windows wants to
use wscript.exe.


My System SpecsSystem Spec
Old 08-05-2009   #5 (permalink)
Al Dunbar


 
 

Re: Maybe I should try a different approach

If that is all, the simplest approach would be to run your script with
cscript.exe, and use wscript.echo liberally to indicate progress. You could
start it from a batch file with the same name and in the same folder as the
script and containing this command:

cscript.exe //nologo "%~dpn0.vbs

When the script terminates, the window will disappear. If the script used
MSGBOX or INPUTBOX they would behave exactly as they do when run using
wscript.exe. You might, for example, include the following at the end of
your script:

MSGBOX "Processing completed. Thanks for your patience"
wscript.quit


/Al


"James" <donotreply@xxxxxx> wrote in message
news:et1S1TgFKHA.4732@xxxxxx
Quote:

> Doesn't need to be impressive at all...just needs to show that something
> is happening and have and end to notify it is done...
>
> James
>
> "Al Dunbar" <alandrub@xxxxxx> wrote in message
> news:uxpORMgFKHA.4608@xxxxxx
Quote:

>>
>> "James" <donotreply@xxxxxx> wrote in message
>> news:ejVEVEgFKHA.1492@xxxxxx
Quote:

>>> Is is possible to simply display a message box with NO BUTTONS for the
>>> entire time my script is running, then have it close when my script is
>>> done and maybe have some dots keep adding to the text message until the
>>> script is fully completed?
>>>
>>> I am a complete newbie and any help would be great!
>>>
>>> James
>>
>> vbscript itself has exactly and only two ways to display information:
>> MSGBOX and INPUTBOX, and the only capabilities these have are the few
>> capabilities noted in the documentation. While either is active the
>> script is waiting for input, so neither could be realistically used for a
>> progress bar.
>>
>> As for a message box with no buttons, you can create whatever you want
>> using html or hta. The trick is for your script to interact with that IE
>> instance, for example, to close it when the script is about to exit. You
>> also need to ensure that it will disappear in the event that your script
>> is terminated by the user or errors out.
>>
>> But perhaps the simplest approach for a newbie would be to run your
>> script using cscript, and use the console window as your progress bar,
>> writing to it with wscript.echo.
>>
>> The question is, how important is it that this be impressive and how
>> important is it that it just works?
>>
>> /Al
>>
>>
>
>


My System SpecsSystem Spec
Old 08-05-2009   #6 (permalink)
mayayana


 
 

Re: Maybe I should try a different approach

You've asked the ame question in 3 different
posts and received pretty much all of the
possible answers more than once. The facts
won't change by multi-posting. You just fill up
the newsgroup and waste people's time.

Quote:

> Is is possible to simply display a message box with NO BUTTONS for the
> entire time my script is running, then have it close when my script is
done
Quote:

> and maybe have some dots keep adding to the text message until the script
is
Quote:

> fully completed?
>
> I am a complete newbie and any help would be great!
>
> James
>
>

My System SpecsSystem Spec
Old 08-05-2009   #7 (permalink)
Richard Mueller [MVP]


 
 

Re: Maybe I should try a different approach


"James" <donotreply@xxxxxx> wrote in message
news:ejVEVEgFKHA.1492@xxxxxx
Quote:

> Is is possible to simply display a message box with NO BUTTONS for the
> entire time my script is running, then have it close when my script is
> done and maybe have some dots keep adding to the text message until the
> script is fully completed?
>
> I am a complete newbie and any help would be great!
>
> James
>
I have an example VScript program linked here that uses IE to display an
interactive message form to the user that indicates progress:

http://www.rlmueller.net/IE%20Display.htm

The trick is that the program needs some way to monitor progress. In the
example, I simply iterate a few times with a delay to similate a time
consuming process. I've used this technique a few times in programs that
take a long time. For example, this VBScript program (two actually)
inventories all computers in the domain:

http://www.rlmueller.net/Inventory.htm

It must connect to each with WMI and uses several classes to collect
information, so it can take awhile. The programs uses Sub InitIE to
initialize an IE box, and Sub MsgIE to update the text in the box. In this
case the name of the computer is changed in the box as the program moves
from one machine to the next. If the program hangs, the user can tell. If
the computer name keeps changing, the user knows to be patient. You may be
able to use these methods if your program has some way to monitor progress.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Old 08-06-2009   #8 (permalink)
James


 
 

Re: Maybe I should try a different approach

You are right about that Mayayana. The reason being, is that nothing is
really accomplishing what I want. I think I will take a stab at an idea I
am having that may do what I am thinking. Maybe something with a
wshshell.popup, a do until loop, and the timeout value. I will post when
done. Take care.

James

"mayayana" <mayaXXyana@xxxxxx> wrote in message
news:edkMfhhFKHA.4208@xxxxxx
Quote:

> You've asked the ame question in 3 different
> posts and received pretty much all of the
> possible answers more than once. The facts
> won't change by multi-posting. You just fill up
> the newsgroup and waste people's time.
>
>
Quote:

>> Is is possible to simply display a message box with NO BUTTONS for the
>> entire time my script is running, then have it close when my script is
> done
Quote:

>> and maybe have some dots keep adding to the text message until the script
> is
Quote:

>> fully completed?
>>
>> I am a complete newbie and any help would be great!
>>
>> James
>>
>>
>
>

My System SpecsSystem Spec
Old 08-06-2009   #9 (permalink)
Eric


 
 

Re: uh-oh. just noticed the (verboten) vbs file


"mr_unreliable" <kindlyReplyToNewsgroup@xxxxxx> wrote in message
news:OlXTb8rFKHA.2832@xxxxxx
Quote:

> For those of you who feel some irrational desire to see
> the file supposedly attached above, but whose AV utility
> has stripped off the "malicious" script, then here it is
> as a more innocent "txt" file.
>
> cheers, jw
>
OE by default shows that there is a .vbs file attached but won't let me
execute it and oddly won't even let me save it. The txt works.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Is this is the correct REST approach? .NET General
Lotus Approach from Smartsuite 9.8 - need help Vista General
A different upgrade approach Vista General
Best Approach for Included Script Files PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46