Returning code to the calling process? 
Author Message
 Returning code to the calling process?

Hello, all!

I've got a VBScript file that I'll be invoking from the command line:

cmd /C "MyScript.vbs".

I'm wondering how to return an error code from VBScript to the command
processor?

Any help would be greatly appreciated!  :-)



Sat, 17 Jul 2004 06:14:22 GMT  
 Returning code to the calling process?
I think I may have found a relevant link:

http://www.winscriptingsolutions.com/Articles/Index.cfm?ArticleID=4733


Quote:
> Hello, all!

> I've got a VBScript file that I'll be invoking from the command line:

> cmd /C "MyScript.vbs".

> I'm wondering how to return an error code from VBScript to the command
> processor?

> Any help would be greatly appreciated!  :-)



Sat, 17 Jul 2004 06:20:53 GMT  
 Returning code to the calling process?
Yes, that's it.

The trick is that cscript is the only thing that "runs" inside the
original command window; runnin a script via wscript spawns it as an
independent process.

if you trap your errors internally, you can also just use a
wscript.echo to pass it out to a command line and capture it in your
batch file.

BTW, I have no clue how well this works on Win9x, if that matters for
you; Windows Scripting Solutions is pretty NTish in focus.


Quote:
> Hello, all!

> I've got a VBScript file that I'll be invoking from the command
line:

> cmd /C "MyScript.vbs".

> I'm wondering how to return an error code from VBScript to the
command
> processor?

> Any help would be greatly appreciated!  :-)



Sat, 17 Jul 2004 07:37:28 GMT  
 Returning code to the calling process?
Heya, Alex!

Thanks for the "heads up"!  Yeah...I'm running on XP.  After a few attempts
(mostly because of hidden "prompts"), I finally got it to work relatively
straightforwardly by using:

cscript C:\MyPath\MyScript.vbs //Nologo

I'm a little annoyed that you can't specify a file for the ActiveX aspect of
the Job.  And it's only limited to ~3000 characters (my file was about 8000
characters).  That's what prompted me to investigate launching it
"externally".

Thanks also to Windows Scripting Solution for the reference!  :-)



Quote:
> Yes, that's it.

> The trick is that cscript is the only thing that "runs" inside the
> original command window; runnin a script via wscript spawns it as an
> independent process.

> if you trap your errors internally, you can also just use a
> wscript.echo to pass it out to a command line and capture it in your
> batch file.

> BTW, I have no clue how well this works on Win9x, if that matters for
> you; Windows Scripting Solutions is pretty NTish in focus.



> > Hello, all!

> > I've got a VBScript file that I'll be invoking from the command
> line:

> > cmd /C "MyScript.vbs".

> > I'm wondering how to return an error code from VBScript to the
> command
> > processor?

> > Any help would be greatly appreciated!  :-)



Sat, 17 Jul 2004 08:20:09 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. return codes from synch'd process

2. return codes from .vbs scripts called from C using system()

3. Howto call a .wsc from .asp without waiting for a return code

4. Calling LogonUser from .Net returns error code 126.

5. Q: Getting calling process from in-process server dll

6. Q: Getting calling process from in-process server dll

7. Q: Getting calling process from in-process server dll

8. API code for Ending a process in NT TaskMgr/Processes Tab

9. stored procedures: return codes and return status with rdo

10. Return code codes to error?

11. Api return codes -- code 234

12. Type returned by process.getprocesses()?

 

 
Powered by phpBB® Forum Software