<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Matt Wilson &#187; cscript</title>
	<atom:link href="http://www.mattwilsoninc.com/tag/cscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattwilsoninc.com</link>
	<description>A glimpse into Web Operations</description>
	<lastBuildDate>Wed, 04 May 2011 00:40:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>CScript Visual C++ Runtime Library Error</title>
		<link>http://www.mattwilsoninc.com/microsoft/cscript-visual-c-runtime-library-error/</link>
		<comments>http://www.mattwilsoninc.com/microsoft/cscript-visual-c-runtime-library-error/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 20:23:22 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Knowledgebase]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.mattwilsoninc.com/?p=44</guid>
		<description><![CDATA[<a href="http://www.mattwilsoninc.com/microsoft/cscript-visual-c-runtime-library-error/" title="CScript Visual C++ Runtime Library Error"></a>Last week I had interesting issue with running cscript to execute wsf jobs on a  Windows Server 2003 x64 Edition Server running SQL Server 2005. Every time Cscript ran, a Microsoft Visual C++ Runtime Library Error popped up. Error Details: &#8230;<p class="read-more"><a href="http://www.mattwilsoninc.com/microsoft/cscript-visual-c-runtime-library-error/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.mattwilsoninc.com/microsoft/cscript-visual-c-runtime-library-error/" title="CScript Visual C++ Runtime Library Error"></a><p>Last week I had interesting issue with running cscript to execute wsf jobs on a  Windows Server 2003 x64 Edition Server running SQL Server 2005. Every time Cscript ran, a Microsoft Visual C++ Runtime Library Error popped up.</p>
<p>Error Details:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Runtime Error!</p>
<p>Program: C:\winnt\system32\cscript.exe</p>
<p>R6034</p>
<p>An Application has made an attempt to load the C runtime library incorrectly. Please contact the application&#8217;s support team for more information.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<div id="attachment_45" class="wp-caption alignnone" style="width: 310px"><a href="http://www.mattwilsoninc.com/wp-content/uploads/2008/08/cscript_issue_bad-server1.png"><img class="size-medium wp-image-45" title="cscript_issue_bad-server1" src="http://www.mattwilsoninc.com/wp-content/uploads/2008/08/cscript_issue_bad-server1-300x185.png" alt="CScript Visual C++ Runtime Lbrary Error" width="300" height="185" /></a><p class="wp-caption-text">CScript Visual C++ Runtime Lbrary Error</p></div>
<p>We have five other SQL Server that run the same job, so I know the job works. In order to find out what was going on, I ran <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx" target="_blank">Process Monitor</a> to see what dlls are being called by cscript. As you can see from the error, the Microsoft Visual C++ Runtime library was being called from the Microsoft SQL Server Tools\Binn directory. CScript should be calling the msvcr80.dll from the C:\winnt\WinSxS directory as noted in the screen shot below. (I ran the job and Process Monitor on a system where the job ran correctly.)</p>
<div id="attachment_46" class="wp-caption alignnone" style="width: 310px"><a href="http://www.mattwilsoninc.com/wp-content/uploads/2008/08/cscript_issue_correct_server.png"><img class="size-medium wp-image-46" title="cscript_issue_correct_server" src="http://www.mattwilsoninc.com/wp-content/uploads/2008/08/cscript_issue_correct_server-300x63.png" alt="CSCript Correctly Calling msvcr80.dll" width="300" height="63" /></a><p class="wp-caption-text">CSCript Correctly Calling msvcr80.dll</p></div>
<p>Now that we know that the incorrect msvcr80.dll is being called, we need to figure out why and how to correct it.</p>
<p>Microsoft WinSxs Directory is for Side-by-Side assemblies and dlls. The Windows Kernel works with Fusion to find the correct dll needed for the application. (Learn more about <a href="http://www.grimes.demon.co.uk/workshops/fusWSThirteen.htm">Fusion</a>). In the case of the working system, fusion was finding the correct msvcr80.dll.</p>
<p><strong>The Result:</strong></p>
<p>The wsf script called SQLDMO.dll for a function call. The working system had an updated version of the dll with a Manifest which pointed to the correct msvcr80.dll.</p>
<p>The problem system had an older version of the dll with no Manifest, so the closest msvcr80.dll was being used after SQLDMO.dll was called.</p>
<p>To fix, The SQLDMO.dll was updated to the latest version and the problem was solved.</p>
<p>With this issue, using Process Monitor was the best tool to figure out what the problem system and the control system were doing since it pointed out the different msvcr80.dlls being used.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.mattwilsoninc.com%2Fmicrosoft%2Fcscript-visual-c-runtime-library-error%2F&amp;title=CScript%20Visual%20C%2B%2B%20Runtime%20Library%20Error" id="wpa2a_2"><img src="http://www.mattwilsoninc.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mattwilsoninc.com/microsoft/cscript-visual-c-runtime-library-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

