 




<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<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>
	<lastBuildDate>Mon, 04 Feb 2013 16:34:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<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><![CDATA[Jeff, I didn&#039;t see this comment until just now. Terribly sorry for the delay in my response. I&#039;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]
&gt;test

&gt;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]<br />
[CODE]Echo off<br />
cscript Yourscript.vbs<br />
If %errorlevel% == 3 goto runexe<br />
Echo “File to old”<br />
goto EndBatch<br />
:runexe<br />
Echo “Error level 3 achieved”<br />
:EndBatch<br />
[/CODE]<br />
[b]YourScript.Bat[/b]<br />
[CODE]wscript.quit(3)[/CODE]</p>
<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><![CDATA[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(&quot;JScript QuitTest&quot;);
WScript.Quit(3);
[/CODE]

[B]QuitTest.vbs[/B]
[CODE]
WScript.Echo(&quot;VBScript QuitTest&quot;)
WScript.Quit(3)
[/CODE]

[B]RUN:[/B]
[CODE]
D:\Workspace&gt;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]<br />
[CODE]<br />
@ECHO OFF</p>
<p>ECHO.<br />
cscript QuitTest.vbs //NoLogo<br />
ECHO QuitTest.vbs: %errorlevel%</p>
<p>ECHO.<br />
cscript QuitTest.js //NoLogo<br />
ECHO QuitTest.js: %errorlevel%<br />
[/CODE]</p>
<p>[B]QuitTest.js[/B]<br />
[CODE]<br />
WScript.Echo(&#8220;JScript QuitTest&#8221;);<br />
WScript.Quit(3);<br />
[/CODE]</p>
<p>[B]QuitTest.vbs[/B]<br />
[CODE]<br />
WScript.Echo(&#8220;VBScript QuitTest&#8221;)<br />
WScript.Quit(3)<br />
[/CODE]</p>
<p>[B]RUN:[/B]<br />
[CODE]<br />
D:\Workspace&gt;QuitTest.cmd</p>
<p>VBScript QuitTest<br />
QuitTest.vbs: 0</p>
<p>JScript QuitTest<br />
QuitTest.js: 0<br />
[/CODE]</p>
<p>Thanks</p>
<p>Jeff in Seattle</p>
]]></content:encoded>
	</item>
</channel>
</rss>
