End VBScript Execution 
Author Message
 End VBScript Execution

Hello

Just a quick question, what is the VBScript equivalent of VB's 'End'
command?  My .vbs application has a series of OK/Cancel message box prompts,
and I want the code to end execution if the user selects Cancel...

Thanks

Joel Malone



Mon, 30 May 2005 09:19:02 GMT  
 End VBScript Execution

Quote:

> Just a quick question, what is the VBScript equivalent of VB's 'End'
> command?  My .vbs application has a series of OK/Cancel message box prompts,
> and I want the code to end execution if the user selects Cancel...

Hi

WScript.Quit

--
torgeir
Microsoft MVP Scripting and WMI
Porsgrunn Norway



Mon, 30 May 2005 09:23:12 GMT  
 End VBScript Execution

Quote:


>> Just a quick question, what is the VBScript equivalent of VB's 'End'
>> command?  My .vbs application has a series of OK/Cancel message box
>> prompts, and I want the code to end execution if the user selects
>> Cancel...

> Hi

> WScript.Quit

And WScript.Quit(integer value) will set the exit code if you want to trap
for that somewhere else.
WScript.Quit(0)
exits with exit code 0
WScript.Quit(3)
exits with exit code 3
WScript.Quit(11)
exits with exit code 11

I call a lot of VBS routines from batch routines so it's important to me
what the status was.  I exit with 0 if all went as expected, then use
different exit codes to indicate different things; example: 1 for user
cancelled the script, 2 for a required external file was not found, etc.
etc.



Tue, 31 May 2005 04:44:49 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Ending execution with //T:

2. Ending program execution

3. At wits end..formula execution

4. ending a DOS shell after execution

5. determining if a shelled program has ended execution (vb3.0)

6. VB5 crashes under W2K after ending execution

7. Terminating Execution in an ASP VBscript

8. Different line ends/segment ends on dashed line?

9. Different line ends/segment ends on dashed line?

10. Detecting end of line and end of file while using the .Read() method

11. Error when scheduling execution of vbscript using AT command

12. vbscript execution opens file in edit mode

 

 
Powered by phpBB® Forum Software