<?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: touch with DOS commands</title>
	<atom:link href="http://brett.batie.com/dosshell/touch-with-dos-commands/feed/" rel="self" type="application/rss+xml" />
	<link>http://brett.batie.com/scripting/touch-with-dos-commands/</link>
	<description>Thoughts of a Software Engineer.</description>
	<lastBuildDate>Thu, 02 Feb 2012 22:08:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: nitin</title>
		<link>http://brett.batie.com/scripting/touch-with-dos-commands/comment-page-1/#comment-9856</link>
		<dc:creator>nitin</dc:creator>
		<pubDate>Thu, 14 Oct 2010 21:27:54 +0000</pubDate>
		<guid isPermaLink="false">http://brett.batie.com/?p=24#comment-9856</guid>
		<description>Perfect Simone &amp; dangerOp. Exactly what I was looking for. My copy /Y nul test.txt was creating the file the first time but I didn&#039;t want it to overwrite the file the next time without popping the confirmation message. type nul &gt;&gt; test.txt worked just fine for me. I was not concerned about the timestamp part anyway. 
Thanks guys.</description>
		<content:encoded><![CDATA[<p>Perfect Simone &amp; dangerOp. Exactly what I was looking for. My copy /Y nul test.txt was creating the file the first time but I didn&#039;t want it to overwrite the file the next time without popping the confirmation message. type nul &gt;&gt; test.txt worked just fine for me. I was not concerned about the timestamp part anyway.<br />
Thanks guys.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dangerOp</title>
		<link>http://brett.batie.com/scripting/touch-with-dos-commands/comment-page-1/#comment-1177</link>
		<dc:creator>dangerOp</dc:creator>
		<pubDate>Tue, 21 Apr 2009 22:18:56 +0000</pubDate>
		<guid isPermaLink="false">http://brett.batie.com/?p=24#comment-1177</guid>
		<description>There are two parts to the behavior of &#039;touch&#039;: 

1) if the file doesn&#039;t exist, create it (which also sets the current date/time)
2) if the file does exist, update the date and time

In both cases, nothing is added or removed from the contents of the file (the first case starts with an empty file).

The use of copy will fail for the first case, and the use of just &#039;type nul &gt;&gt; foo&#039; will not work for the second case.  You will have to combine both of these approaches:

touch.bat:
==============
@echo off
type nul &gt;&gt; %1
copy /b %1 +,,</description>
		<content:encoded><![CDATA[<p>There are two parts to the behavior of &#039;touch&#039;: </p>
<p>1) if the file doesn&#039;t exist, create it (which also sets the current date/time)<br />
2) if the file does exist, update the date and time</p>
<p>In both cases, nothing is added or removed from the contents of the file (the first case starts with an empty file).</p>
<p>The use of copy will fail for the first case, and the use of just &#039;type nul &gt;&gt; foo&#039; will not work for the second case.  You will have to combine both of these approaches:</p>
<p>touch.bat:<br />
==============<br />
@echo off<br />
type nul &gt;&gt; %1<br />
copy /b %1 +,,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simone</title>
		<link>http://brett.batie.com/scripting/touch-with-dos-commands/comment-page-1/#comment-306</link>
		<dc:creator>Simone</dc:creator>
		<pubDate>Fri, 03 Oct 2008 15:36:58 +0000</pubDate>
		<guid isPermaLink="false">http://brett.batie.com/?p=24#comment-306</guid>
		<description>type nul &gt;&gt; &quot;c:\file.txt&quot;</description>
		<content:encoded><![CDATA[<p>type nul &gt;&gt; &#034;c:\file.txt&#034;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dolphin</title>
		<link>http://brett.batie.com/scripting/touch-with-dos-commands/comment-page-1/#comment-304</link>
		<dc:creator>dolphin</dc:creator>
		<pubDate>Fri, 26 Sep 2008 17:02:46 +0000</pubDate>
		<guid isPermaLink="false">http://brett.batie.com/?p=24#comment-304</guid>
		<description>@COPY /B %1 +,,


I found that command on the following page:
http://support.microsoft.com/kb/69581</description>
		<content:encoded><![CDATA[<p>@COPY /B %1 +,,</p>
<p>I found that command on the following page:<br />
<a href="http://support.microsoft.com/kb/69581" rel="nofollow">http://support.microsoft.com/kb/69581</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: masc</title>
		<link>http://brett.batie.com/scripting/touch-with-dos-commands/comment-page-1/#comment-65</link>
		<dc:creator>masc</dc:creator>
		<pubDate>Sun, 17 Feb 2008 23:24:48 +0000</pubDate>
		<guid isPermaLink="false">http://brett.batie.com/?p=24#comment-65</guid>
		<description>@copy %1 + nul %1 /by

also works, provided copy is new enough to test that it shouldn&#039;t overwrite the original file</description>
		<content:encoded><![CDATA[<p>@copy %1 + nul %1 /by</p>
<p>also works, provided copy is new enough to test that it shouldn&#039;t overwrite the original file</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: masc</title>
		<link>http://brett.batie.com/scripting/touch-with-dos-commands/comment-page-1/#comment-64</link>
		<dc:creator>masc</dc:creator>
		<pubDate>Sun, 17 Feb 2008 22:24:40 +0000</pubDate>
		<guid isPermaLink="false">http://brett.batie.com/?p=24#comment-64</guid>
		<description>@copy nul: /b +%1 tmp.$$$
@move tmp.$$$ %1

=touch.bat
doesn&#039;t change anything in file.org, only time and date</description>
		<content:encoded><![CDATA[<p>@copy nul: /b +%1 tmp.$$$<br />
@move tmp.$$$ %1</p>
<p>=touch.bat<br />
doesn&#039;t change anything in file.org, only time and date</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://brett.batie.com/scripting/touch-with-dos-commands/comment-page-1/#comment-57</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Tue, 12 Feb 2008 23:02:12 +0000</pubDate>
		<guid isPermaLink="false">http://brett.batie.com/?p=24#comment-57</guid>
		<description>You are right! I have only used that command to quickly create an empty file. I have never used it for updating the modification time of an existing file.

I do not know of a way to modify the date modified of a file in dos without using a third party program. Although, if you want the date modified to be updated to the current time you could use one of the follow commands:

1. This copies the file to a temp File and then copies the temp File back over the original. Then deletes the temp File. 
type file.txt &gt; tmpFile.txt &#124; type tmpFile.txt &gt; file.txt &#124; del tmpFile.txt

2. Type: edit file.txt, then hit: alt, f, s, alt, f, x

I really think both solutions are hacks at best. I also wonder what would happen to unicode files or files that have unix style line endings.</description>
		<content:encoded><![CDATA[<p>You are right! I have only used that command to quickly create an empty file. I have never used it for updating the modification time of an existing file.</p>
<p>I do not know of a way to modify the date modified of a file in dos without using a third party program. Although, if you want the date modified to be updated to the current time you could use one of the follow commands:</p>
<p>1. This copies the file to a temp File and then copies the temp File back over the original. Then deletes the temp File.<br />
type file.txt > tmpFile.txt | type tmpFile.txt > file.txt | del tmpFile.txt</p>
<p>2. Type: edit file.txt, then hit: alt, f, s, alt, f, x</p>
<p>I really think both solutions are hacks at best. I also wonder what would happen to unicode files or files that have unix style line endings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: errr</title>
		<link>http://brett.batie.com/scripting/touch-with-dos-commands/comment-page-1/#comment-56</link>
		<dc:creator>errr</dc:creator>
		<pubDate>Tue, 12 Feb 2008 20:46:28 +0000</pubDate>
		<guid isPermaLink="false">http://brett.batie.com/?p=24#comment-56</guid>
		<description>That seems to clear(!!) the file, rather than touching it</description>
		<content:encoded><![CDATA[<p>That seems to clear(!!) the file, rather than touching it</p>
]]></content:encoded>
	</item>
</channel>
</rss>

