<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Communicating error levels to a calling application from with in VBScript</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/communicating-error-levels-to-a-calling-application-with-vbscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/communicating-error-levels-to-a-calling-application-with-vbscript/</link>
	<description></description>
	<pubDate>Sun, 08 Nov 2009 17:57:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Jlees</title>
		<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/communicating-error-levels-to-a-calling-application-with-vbscript/#comment-40</link>
		<dc:creator>Jlees</dc:creator>
		<pubDate>Fri, 12 Dec 2008 15:06:06 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/communicating-error-levels-to-a-calling-application-with-vbscript/#comment-40</guid>
		<description>Jeff, I didn't see this comment until just now. Terribly sorry for the delay in my response. I'm not sure what the issue may be, I quickly wrote the following and it works as  specified. Have you gotten it figured out already?

[b]Test.bat[/b]
[CODE]Echo off
cscript Yourscript.vbs
If %errorlevel% == 3 goto runexe
Echo “File to old”
goto EndBatch
:runexe
Echo “Error level 3 achieved”
:EndBatch
[/CODE]
[b]YourScript.Bat[/b]
[CODE]wscript.quit(3)[/CODE]

[b]run of test.bat from a command prompt[/b]
&#62;test

&#62;Echo off
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Error level 3 achieved</description>
		<content:encoded><![CDATA[<p>Jeff, I didn&#8217;t see this comment until just now. Terribly sorry for the delay in my response. I&#8217;m not sure what the issue may be, I quickly wrote the following and it works as  specified. Have you gotten it figured out already?</p>
<p>[b]Test.bat[/b]</p>
<pre>Echo off
cscript Yourscript.vbs
If %errorlevel% == 3 goto runexe
Echo “File to old”
goto EndBatch
:runexe
Echo “Error level 3 achieved”
:EndBatch
</pre>
<p>[b]YourScript.Bat[/b]</p>
<pre>wscript.quit(3)</pre>
<p>[b]run of test.bat from a command prompt[/b]<br />
&gt;test</p>
<p>&gt;Echo off<br />
Microsoft (R) Windows Script Host Version 5.6<br />
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.</p>
<p>Error level 3 achieved</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jefftanner</title>
		<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/communicating-error-levels-to-a-calling-application-with-vbscript/#comment-36</link>
		<dc:creator>Jefftanner</dc:creator>
		<pubDate>Sun, 09 Nov 2008 05:41:36 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/communicating-error-levels-to-a-calling-application-with-vbscript/#comment-36</guid>
		<description>I have tried the following, and I cannot get [B]%ERRORLEVEL%[/B] to be set any other value but zero(0) after using [B]WScript.Quit(3)[/B] within [B]VBScript[/B] and [B]JScript[/B] files.

Here is my code. What I am doing wrong?

[B]QuitTest.cmd[/B]
[CODE]
@ECHO OFF

ECHO.
cscript QuitTest.vbs //NoLogo
ECHO QuitTest.vbs: %errorlevel%

ECHO.
cscript QuitTest.js //NoLogo
ECHO QuitTest.js: %errorlevel%
[/CODE]

[B]QuitTest.js[/B]
[CODE]
WScript.Echo("JScript QuitTest");
WScript.Quit(3);
[/CODE]

[B]QuitTest.vbs[/B]
[CODE]
WScript.Echo("VBScript QuitTest")
WScript.Quit(3)
[/CODE]

[B]RUN:[/B]
[CODE]
D:\Workspace&#62;QuitTest.cmd

VBScript QuitTest
QuitTest.vbs: 0

JScript QuitTest
QuitTest.js: 0
[/CODE]

Thanks

Jeff in Seattle</description>
		<content:encoded><![CDATA[<p>I have tried the following, and I cannot get <b>%ERRORLEVEL%</b> to be set any other value but zero(0) after using <b>WScript.Quit(3)</b> within <b>VBScript</b> and <b>JScript</b> files.</p>
<p>Here is my code. What I am doing wrong?</p>
<p><b>QuitTest.cmd</b></p>
<pre>
@ECHO OFF

ECHO.
cscript QuitTest.vbs //NoLogo
ECHO QuitTest.vbs: %errorlevel%

ECHO.
cscript QuitTest.js //NoLogo
ECHO QuitTest.js: %errorlevel%
</pre>
<p><b>QuitTest.js</b></p>
<pre>
WScript.Echo("JScript QuitTest");
WScript.Quit(3);
</pre>
<p><b>QuitTest.vbs</b></p>
<pre>
WScript.Echo("VBScript QuitTest")
WScript.Quit(3)
</pre>
<p><b>RUN:</b></p>
<pre>
D:\Workspace&gt;QuitTest.cmd

VBScript QuitTest
QuitTest.vbs: 0

JScript QuitTest
QuitTest.js: 0
</pre>
<p>Thanks</p>
<p>Jeff in Seattle</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- dynamic -->