<?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>勿慢牛 &#187; 批处理</title>
	<atom:link href="http://klniu.com/post/tag/%e6%89%b9%e5%a4%84%e7%90%86/feed/" rel="self" type="application/rss+xml" />
	<link>http://klniu.com</link>
	<description>『勿慢牛个人博客』</description>
	<lastBuildDate>Fri, 06 Jan 2012 06:42:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>倒计时批处理</title>
		<link>http://klniu.com/post/timer/</link>
		<comments>http://klniu.com/post/timer/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 11:41:50 +0000</pubDate>
		<dc:creator>勿慢牛</dc:creator>
				<category><![CDATA[原创]]></category>
		<category><![CDATA[倒计时]]></category>
		<category><![CDATA[定时]]></category>
		<category><![CDATA[批处理]]></category>

		<guid isPermaLink="false">http://livesdrop.com/post/timer/</guid>
		<description><![CDATA[近来一直在玩网页游戏热血三国，游戏开发挺不错，就是如果运营商不要那么疯狂的挣钱就好了，呵呵，题外话。一直在找定时器，可找到的不是太复杂就是太占内存，游侠网有一个出征计时器，只是好像有点占内存，没办法，我每次还要开很多其他的程序，所以就萌生了用批处理来写一个定时器的想法，即方便占用内存又小。缺点是精确度没那么高，但一个小时之内定时是没有问题的。使用方法：直接双击执行，输入 分钟.秒 //eg. 0.10 or 1.10 倒计时完成后，批处理会返回刚打开时的界面 下面是截图： &#160; 以下是批处理代码： @echo off :: creat by budgerigar from http://livesdrop.com :: 2009.02.28 color 1f title倒计时 mode con lines=10 :start set /p delay=请输入min.sec格式的时间，不接受其他格式的输入: for /F &#34;tokens=1,2 delims=.&#34; %%a in (&#34;%delay%&#34;) do set /A &#8230; <a href="http://klniu.com/post/timer/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>近来一直在玩网页游戏热血三国，游戏开发挺不错，就是如果运营商不要那么疯狂的挣钱就好了，呵呵，题外话。一直在找定时器，可找到的不是太复杂就是太占内存，游侠网有一个出征计时器，只是好像有点占内存，没办法，我每次还要开很多其他的程序，所以就萌生了用批处理来写一个定时器的想法，即方便占用内存又小。缺点是精确度没那么高，但一个小时之内定时是没有问题的。使用方法：直接双击执行，输入</p>
<pre class="brush: plain;">分钟.秒            //eg. 0.10 or 1.10</pre>
<p>倒计时完成后，批处理会返回刚打开时的界面</p>
<p>下面是截图：</p>
<p style="text-align: center; "><a href="http://pic.klniu.com/pictures/timer2.jpg"><img alt="timer.jpg" class="pie-img aligncenter" height="195" src="http://pic.klniu.com/pictures/timer2.jpg" style="margin-top: 10px; margin-bottom: 10px;" title="timer2.jpg" width="640" /></a><a href="http://pic.klniu.com/pictures/timer.jpg"><img alt="timer.jpg" height="197" src="http://pic.klniu.com/pictures/timer.jpg" title="timer.jpg" width="640" /></a></p>
<p style="text-align: center;">&nbsp;</p>
<p>以下是批处理代码：</p>
<pre class="brush:plain;">@echo off
:: creat by budgerigar from http://livesdrop.com
:: 2009.02.28
color 1f
title倒计时
mode con lines=10
:start
set /p delay=请输入min.sec格式的时间，不接受其他格式的输入:
for /F &quot;tokens=1,2 delims=.&quot; %%a in (&quot;%delay%&quot;) do set /A min=%%a &amp;&amp; set /a sec=%%b
set /A sec+=%min%*60
set n=0
set time=%sec%

:show
cls
echo  逝去时间: %n% / %sec%                                        剩余时间: %time%秒
if %time%==0 goto exec
ping -n 2 127.0.0.1 &gt;nul
set /a n=%n%+1
set /a time=%sec%-%n%
goto show

:exec
alarm.exe &amp; alarm.exe &amp; alarm.exe &amp; alarm.exe &amp; wav.exe timeout.wav /Q
goto start</pre>
<p>这个批处理用到了两个额外的文件，是为了报警用的。执行alarm.exe时，主机会发出滴的声音，和系统声音无关，这个是为了方便不带耳机的时候使用的，如果不想要的可以把</p>
<pre class="brush:plain;">alarm.exe &amp; alarm.exe &amp; alarm.exe &amp; alarm.exe</pre>
<p>去掉即可；执行wav.exe时，会播放wav，当然，这是静默处理的，不会弹出窗口。你可以把timeout.wav换成自己喜欢的音乐文件，但是名称还必须是timeout.wav，当然你也可以修改批处理。</p>
<p>提醒：可以把批处理的快捷方式放到快速启动栏里，会方便很多。</p>
<p>下载该文件：<a href="http://klniu.com/wordpress/url/timer-download/" target="_blank">点击下载</a></p>
]]></content:encoded>
			<wfw:commentRss>http://klniu.com/post/timer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

