 




<?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>The VBScript Network and Systems Administrator&#039;s Cafe &#187; batch commands</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/tag/batch-commands/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator</link>
	<description></description>
	<lastBuildDate>Tue, 11 Oct 2011 18:36:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Windows Tip: Clearing Internet Explorer cached data from the command line</title>
		<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/windows-tips-clearing-internet-explorer-cached-data-from-the-command-line/</link>
		<comments>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/windows-tips-clearing-internet-explorer-cached-data-from-the-command-line/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 04:14:08 +0000</pubDate>
		<dc:creator>Jerry Lees</dc:creator>
				<category><![CDATA[batch commands]]></category>
		<category><![CDATA[batch files]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[rundll.exe]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[undocumented windows]]></category>
		<category><![CDATA[windows secrets]]></category>
		<category><![CDATA[windows tips]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/?p=186</guid>
		<description><![CDATA[As a Network Administrator sometimes you need to clear the browsing history, cookies, or the like for a entire community of users. Sure, you could tell them how to do it thinking that you were being super smart by providing instructions for them. However, as you well know there will be some who will be unable [...]]]></description>
				<content:encoded><![CDATA[<p>As a Network Administrator sometimes you need to clear the browsing history, cookies, or the like for a entire community of users. Sure, you could tell them how to do it thinking that you were being super smart by providing instructions for them. However, as you well know there will be some who will be unable to follow the directions and you will spend 3 times the amount of time it took you to write the directions and refine them to a point where any one could do it&#8212; or so you thought. All the while, thinking about the amount of time you will save by having the users do it.</p>
<p>Why not be really lazy!!!??!? And do it with a batch script? You could then put it in their login script and it would happen at their next logon, or every logon for that matter. Well, there&#8217;s an easy way to do this with windows&#8217; built in functions&#8211; it&#8217;s just obscure enough to not be found anywhere you would normally look!</p>
<p>Yo can preform many of the things I mentioned (and more) with Microsoft&#8217;s RUNDLL.EXE file, plus you don&#8217;t have to write a line of VBScript to accomplish the task!</p>
<p>Here is a short list of some tasks you can preform on IE, along with the command to do it&#8230; give them a shot!</p>
<p><strong>Temporary Internet Files<br />
</strong>RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8</p>
<p><strong>Cookies<br />
</strong>RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2</p>
<p><strong>History<br />
</strong>RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1</p>
<p><strong>Form Data<br />
</strong>RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16</p>
<p><strong>Passwords<br />
</strong>RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32</p>
<p><strong>Delete All<br />
</strong>RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255</p>
<p><strong>Delete All &#8211; &#8220;Also delete files and settings stored by add-ons&#8221;<br />
</strong>RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351</p>
<p> These commands should work in Internet Explorer 7</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/windows-tips-clearing-internet-explorer-cached-data-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Communicating error levels to a calling application from with in VBScript</title>
		<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/communicating-error-levels-to-a-calling-application-with-vbscript/</link>
		<comments>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/communicating-error-levels-to-a-calling-application-with-vbscript/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 23:11:30 +0000</pubDate>
		<dc:creator>Jerry Lees</dc:creator>
				<category><![CDATA[batch commands]]></category>
		<category><![CDATA[Error control]]></category>
		<category><![CDATA[errorlevel]]></category>
		<category><![CDATA[exit]]></category>
		<category><![CDATA[on error]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[wscript]]></category>
		<category><![CDATA[WScript.quit]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/communicating-error-levels-to-a-calling-application-with-vbscript/</guid>
		<description><![CDATA[We&#8217;ve discussed error handling previously (via the On Error Goto 0 command) in a entry titled, Using error control in a VBScript to recover from odd errors. However, occasionally you need to communicate a condition back to an application or batch file that calls a script as part of its processing. One reason you may need [...]]]></description>
				<content:encoded><![CDATA[<p>We&#8217;ve discussed error handling previously (via the <em>On Error Goto 0</em> command) in a entry titled, <a href="http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/using-error-control-in-a-vbscript-to-recover-from-odd-errors/">Using error control in a VBScript to recover from odd errors</a>. However, occasionally you need to communicate a condition back to an application or batch file that calls a script as part of its processing. One reason you may need to do this is if you need to call a separate script or application depending on the outcome of the script. You can do this with what is called an error level. Keep in mind this may not have anything to do with an error in the script but can, instead, be used as a method to control how another applicatioin responds to a particular condition.</p>
<p>For example, say you already have a executable that processes a file into a database&#8211; but you don&#8217;t want to run the executable on a old file because it would cause all sorts of duplicated entries in the database. you might not be able to go back to the person who wrote the executable and have them change it or the executable might not have even been written by the company where you work! You could, however write a script to check the date of a file and if it was created during a time frame return a error level back to a batch file that calls your script and preforms the logic to decide if the executable needed to be ran. Take this batch file for example:</p>
<p><font color="#0000ff">Echo off<br />
cscript Yourscript.vbs<br />
If %errorlevel% == 3 goto runexe<br />
Echo &#8220;File to old&#8221;<br />
goto EndBatch<br />
:runexe<br />
processingprogram.exe<br />
:EndBatch</font></p>
<p>This would only run the executable <strong>IF</strong> your script returned a error level of 3! So you can then preform work and checks never intended by the executable when it was written only if the conditions are correct for it to run.</p>
<p>The line of code in VBScript you would add to your  script to communicate back to the batch file would be:</p>
<p><font color="#0000ff">WScript.quit(3)</font></p>
<p>This will return a error level of 3 back to the batch file and cause the batch file to THEN run your executable.</p>
<p>So, there you have it! A quick and simple method to extend the life of those aging processes that work fine&#8211; just need a minor tweak because your environment has changed.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/communicating-error-levels-to-a-calling-application-with-vbscript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
