<?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>Teh Tech &#187; Log</title>
	<atom:link href="http://tehtech.com/tag/log/feed/" rel="self" type="application/rss+xml" />
	<link>http://tehtech.com</link>
	<description>Being an Admin is Hard Enough</description>
	<lastBuildDate>Wed, 14 Jul 2010 16:14:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Add Date and Time to any Batch File Output</title>
		<link>http://tehtech.com/add-date-and-time-to-any-batch-file-output/</link>
		<comments>http://tehtech.com/add-date-and-time-to-any-batch-file-output/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 14:59:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Batch]]></category>
		<category><![CDATA[Log]]></category>
		<category><![CDATA[Time]]></category>

		<guid isPermaLink="false">http://tehtech.com/?p=352</guid>
		<description><![CDATA[This trick is useful for both troubleshooting batch file tasks and when using a batch file to create a log. For example I have a scheduled task that renames some of my backup folders at night and then moved a few files around for me. When the batch file starts I uses the below code [...]]]></description>
			<content:encoded><![CDATA[<p>This trick is useful for both troubleshooting batch file tasks and when using a batch file to create a log. For example I have a scheduled task that renames some of my backup folders at night and then moved a few files around for me. When the batch file starts I uses the below code to print the time it starts, I repeat the two lines at the end of the batch file so that I can see what time the job completed. This is useful for figuring out average time of a task so that you can schedule other things without interfering.</p>
<p><span id="more-352"></span><br />
<script type="text/javascript"><!--
google_ad_client = "pub-2740910196434334";
google_ad_slot = "5492961778";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<div class="box">Date /T &gt;&gt; c:\script.log<br />
Time /T &gt;&gt; c:\script.log</div>
<p>Â </p>
<p>And here is what it looks like in a actual batch file:</p>
<div class="box">Echo running backup script &gt;&gt; G:\log\backup.log<br />
Date /T &gt;&gt; G:\log\backup.log<br />
Time /T &gt;&gt; G:\log\backup.log<br />
Rename f:\backup\full f:\backup\full_old<br />
md f:\backup\full<br />
Move f:\backup\full_old g:\archive<br />
Delete f:\backup\full\log.txt<br />
Echo completed at &gt;&gt; G:\log\backup.log<br />
Date /T &gt;&gt; G:\log\backup.log</div>
<div class="box">Time /T &gt;&gt; G:\log\backup.log</div>
<p>Â </p>
<p>The output would look like:</p>
<div class="box">Running backup script<br />
Thu 04/23/2009<br />
10:53 AM<br />
Completed at<br />
Thu 04/23/2009<br />
11:23 AM</div>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2740910196434334";
google_ad_slot = "5492961778";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://tehtech.com/add-date-and-time-to-any-batch-file-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

