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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Splash screen for script 1

Status
Not open for further replies.

M4rkC

MIS
Oct 26, 2009
13
GB
Hi Guys,

Now I have my PST move script working how I want it, I want to inform users that something is happening.

I'm hoping a nice splash screen will stop the "Hey! Why is my Outlook flashing on and off" and "Hey, why isn't my computer loading anything else (CTRL+ALT+DEL, kill process)".

The best solution I've found from Googl'ing is to open an HTA window with no ability to close it. I can make this look how I want and include info to the user, all fine and dandy.

But, how do I close it when the vbscript has come to the end? I've tried objScript.Quit and objScript.Close but it says it doesn't support these.

Code:
Dim objSplash
Set objSplash = CreateObject("Wscript.shell")
objSplash.Run "movepstsplash.hta"

I thought about modifying Geate's code for closing the Windows Process, but this seems over the top and it refused to work.
 
it will load up the mshta.exe, so this is the thread you will want to kill (but not very nice)

why not just put all your vbscript in the hta itself? well actually i would wager that is bad form...how about having your vbscript as an include in the hta? that way you maintain some extraction between computation and GUI and you can reuse your vbs without the hta where appropriate? at least this way you only have to deal with one thread?

is there a mshta COM object like IE or Word etc exposes? you could bind to the open instance and .close it like you can with IE and word etc?

thinking aloud when i shouldnt worst case is that your hta could have a function which is started onload and it looks for a flag file or registry key and when it exists it closes itself, you can set this flag file or reg entry in your calling vbscript...would work but introduces issues of its own and is pretty ugly
 
I did try and kill the mshta.exe process but it complained about not having one of the variables declared. Plus, it isn't nice.

I think I understand what you're after, but I'm not sure how to implement it.

Do you mean that I could put the vbs inside the hta file, and then just have the hta cleanly close when it's finished running the vbs? Why would that be bad form?

(Still new to this, sorry).
 
note the 'selectionlists.vbs' src file (include file)
this allows you to include all the functions / subs etc from the selectionlists.vbs file and make use of them from your hta.

one might say it is splitting hairs and there is little difference between the include file bit and literally copying and paste'n the contents of the selectionlist.vbs into the hta.

why would i think it is bad form (take aim if you wish)? personally i think it is best practice to seperate data, computation and gui. in vbscript terms one could see it resulting in 3 or more files, e.g. a hta with the GUI part, a vbs with the computation and an xml file with the data.

taking it a step further would be to form your data in such a way that it actually renders the computation benign (i havent expressed that very well).

<html>
<head>
<title>CPF Visio Engine</title>
<HTA:APPLICATION
ID="getInput"
APPLICATIONNAME="CPF_Engine"
SCROLL="yes"
SINGLEINSTANCE="no"
>
</head>
<script language="VBScript" src="selectionlists.vbs"></script>
<SCRIPT LANGUAGE="VBScript">

 
Ok, I see. So it's more for keeping things neat and 'modular' I suppose, so it's easier to see what's where and troubleshoot?
 
yeap, in the broader scheme it means you can considate all of your data upstream if you wish, it means you dont have to look into code to see what is going to happen (you can look at the data instead), it means you can reuse your computation without the GUI when necassary, means different people / teams can work on different aspects...taking things a little far in this example :)

with your task you might say that if you support multiple countries / languages then you might want a data file which the hta consumes which specifies the text to display (in diff languages) based on machines regional settings etc
 
How did you get a HTA to open with no way of closing it?
I have a HTA i want to stay open but ALT F4 will always close it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top