<?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>TechBlog &#187; DOS</title>
	<atom:link href="http://techblog.byllemos.com/tag/dos/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.byllemos.com</link>
	<description>Accelerating into the Future with Wisdom about Technology! Ingrid Byllemos</description>
	<lastBuildDate>Tue, 05 Jan 2010 00:04:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>View your IP address</title>
		<link>http://techblog.byllemos.com/2007/10/view-your-ip-address/</link>
		<comments>http://techblog.byllemos.com/2007/10/view-your-ip-address/#comments</comments>
		<pubDate>Sat, 20 Oct 2007 15:18:50 +0000</pubDate>
		<dc:creator>iby</dc:creator>
				<category><![CDATA[DOS]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[XP]]></category>

		<guid isPermaLink="false">http://techblog.byllemos.com/?p=12</guid>
		<description><![CDATA[<p>A quick way to view your IP address is by using the command IPCONFIG.</p>
<p>Just start a command prompt:</p>
<blockquote><p>Start -&#62; Run -&#62; Cmd</p></blockquote>
<p>and then type:</p>
<p><span id="more-12"></span></p>
<blockquote><p>IPCONFIG /ALL</p></blockquote>
<p>In case of you want to change you IP (works&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>A quick way to view your IP address is by using the command IPCONFIG.</p>
<p>Just start a command prompt:</p>
<blockquote><p>Start -&gt; Run -&gt; Cmd</p></blockquote>
<p>and then type:</p>
<p><span id="more-12"></span></p>
<blockquote><p>IPCONFIG /ALL</p></blockquote>
<p>In case of you want to change you IP (works only when you are running DHCP) &#8211; you can do i by using a release in combination with a renew.</p>
<blockquote><p>IPCONFIG /RELEASE</p>
<p>IPCONFIG /RENEW</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://techblog.byllemos.com/2007/10/view-your-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is FTP</title>
		<link>http://techblog.byllemos.com/2006/09/what-is-ftp/</link>
		<comments>http://techblog.byllemos.com/2006/09/what-is-ftp/#comments</comments>
		<pubDate>Fri, 29 Sep 2006 19:38:27 +0000</pubDate>
		<dc:creator>iby</dc:creator>
				<category><![CDATA[DOS]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[Operating Systems]]></category>

		<guid isPermaLink="false">http://techblog.byllemos.com/?p=41</guid>
		<description><![CDATA[<p>FTP (File Transfer Protocol) is used to transfer files between computers on a Network.</p>
<p>There a several ways to use ftp &#8211; here are some of them:</p>
<ul>
<li>From a command prompt &#8211; by using the command ftp</li>
<li>Directly in</li></ul><p>&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>FTP (File Transfer Protocol) is used to transfer files between computers on a Network.</p>
<p>There a several ways to use ftp &#8211; here are some of them:</p>
<ul>
<li>From a command prompt &#8211; by using the command ftp</li>
<li>Directly in a browser by using a url like: ftp://ftpserver</li>
<li>Using a ftp client</li>
</ul>
<p>In this article, we will be looking on the dos command ftp.<br />
<span id="more-41"></span><br />
First you have to start a dos prompt, by either</p>
<blockquote><p> chose Run -&gt; Type cmd or command</p></blockquote>
<p>or simple use the shortcut for the command prompt.</p>
<p>Next you have to move to / create a transfer directory. It is the directory that you would like to use for file transfer. Receive files will be stored here.</p>
<p>This is how you move between directories in dos:</p>
<blockquote>
<table>
<tr>
<td width="100">cd\</td>
<td>Go to the root directory (c:\)</td>
</tr>
<tr>
<td>cd..</td>
<td>Go one step back. Ex. you are standing in c:\aa\bb\cc a cd.. would place you in c:\aa\bb\</td>
</tr>
<tr>
<td>cd directory</td>
<td>Go to a specific directory.</td>
</tr>
</table>
</blockquote>
<p>Once you are standing in your transfer directory &#8211; you are ready for starting a ftp connection.</p>
<blockquote><p>Type FTP followed by a space and the servername to which you will connect<br />
Ex. ftp my.ftpserver.com</p></blockquote>
<p>Now a connection to the server is initiated and you will be prompted for a username and password. If you are connecting to an anonymous server, the username is anonymous and the password is a email address.  Otherwise use you personal username and password.</p>
<p>If you are connected and have type a wrong password or username.  You can type user followed by enter &#8211; and you will once again be asked to enter your username and password.</p>
<p>When your username and password has been acknowledged you are ready to move around and transfer files.</p>
<blockquote><p>To change directories use the cd command<br />
To list files in a directory use the ls or dir command</p></blockquote>
<p>When you first have found the files that you want to get from the ftpserver you can collect them  by doing the following:</p>
<p>If it is not a textfile you have to change the tranfer mode to binary</p>
<blockquote><p>To transfer a binary file, enter binary at the prompt.<br />
Ex.:</p>
<blockquote><p>ftp&gt; binary<br />
200 Type set to I<br />
ftp&gt;</p></blockquote>
</blockquote>
<p>and collect the file by using the get command followed by a space and the name of the file.</p>
<blockquote><p> Ex.</p>
<blockquote><p> ftp&gt; get demo.exe<br />
200 PORT command successful. Consider using PASV.<br />
150 Opening BINARY mode data connection for demo.exe (1019 bytes).<br />
226 File send OK.<br />
ftp: 1019 byte modtaget i 0,01 sekunder 101,90 ved Kbyte/sek.<br />
ftp&gt;</p></blockquote>
</blockquote>
<p>You can transfer a file to the ftp server by using the put command followed by a space and a filename.</p>
<blockquote><p>Ex.</p>
<blockquote><p> ftp&gt; put test.txt<br />
200 PORT command successful. Consider using PASV.<br />
150 Ok to send data.<br />
226 File receive OK.<br />
ftp: 1019 byte sendt i 0,00 sekunder 1019000,00 ved Kbyte/sek.<br />
ftp&gt;</p></blockquote>
</blockquote>
<p>To end the ftp session use the bye command.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.byllemos.com/2006/09/what-is-ftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zip files in a script</title>
		<link>http://techblog.byllemos.com/2006/05/zip-files-in-a-script/</link>
		<comments>http://techblog.byllemos.com/2006/05/zip-files-in-a-script/#comments</comments>
		<pubDate>Wed, 03 May 2006 22:46:05 +0000</pubDate>
		<dc:creator>iby</dc:creator>
				<category><![CDATA[DOS]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[AT]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Zip]]></category>

		<guid isPermaLink="false">http://techblog.byllemos.com/?p=44</guid>
		<description><![CDATA[<p>If you have an application running, which creates a lot of log files &#8211; it would be neat to have simple functionality to zip those files. This is possible, just using dos scripts and the AT functionality.</p>
<p>First the script&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>If you have an application running, which creates a lot of log files &#8211; it would be neat to have simple functionality to zip those files. This is possible, just using dos scripts and the AT functionality.</p>
<p>First the script – it could look something like this:</p>
<p><span id="more-44"></span></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow">FindDate ----------------------------------------------------
for /f &quot;tokens=<span style="">1</span>-<span style="">4</span> delims=/.- &quot; %%A in <span class="br0">&#40;</span>'date /t'<span class="br0">&#41;</span> do <span class="br0">&#40;</span>
    set DD=%%A&amp;set MM=%%B&amp;set YYYY=%%C&amp;set Junk=%%D&amp;goto End<span class="br0">&#41;</span>
&nbsp;
:Parse --------------------------------------------------------------
echo Date: YYYY=%YYYY% MM=%MM% DD=%DD% JUNK=%Junk%
&nbsp;
:End ----------------------------------------------------------------
move c:\log\*.log c:\log\*.bck
c:\tools\zip.exe -m c:\log\Log%YYYY%-%MM%-%DD%.zip c:\log\*.bck</div></pre><!--END_DEVFMTCODE--><br />
</p>
<p>Lets take a closer look.</p>
<p>First we get today&#8217;s date by getting date and splitting into the peaces YYYY, MM, DD, JUNK, where JUNK is seconds, milliseconds and so on.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow">
for /f &quot;tokens=1-4 delims=/.- &quot; %%A in <span class="br0">&#40;</span>'date /t'<span class="br0">&#41;</span> do <span class="br0">&#40;</span>
set DD=%%A&amp;amp;set MM=%%B&amp;amp;set YYYY=%%C&amp;amp;set Junk=%%D&amp;amp;goto End<span class="br0">&#41;</span></div></pre><!--END_DEVFMTCODE--></p>
<p>Notice – the setting of DD, MM and so on, differs from system to system. The above line works for a Windows 2003, where as the following line would work for a Windows 2000:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow">set Junk=%%A&amp;amp;set DD=%%B&amp;amp;set MM=%%C&amp;amp;set YYYY=%%D&amp;amp;goto End<span class="br0">&#41;</span></div></pre><!--END_DEVFMTCODE--></p>
<p>Next we moves the files, this is to make sure that no application is writing to it.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow">move c:\log\*.log c:\log\*.bck</div></pre><!--END_DEVFMTCODE--></p>
<p>and finaly the files are being zipped, using a dos version of zip.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow">c:\tools\zip.exe -m c:\log\backup\Log%YYYY%-%MM%-%DD%.zip c:\log\*.bck</div></pre><!--END_DEVFMTCODE--></p>
<p>Now you have build the script, and can save into a file called backup.cmd (the extension could also be bat).</p>
<p>The next thing to do, is getting the script scheduled. In this way we don&#8217;t have to execute it manually every day. To do this we are using the AT command.</p>
<p>In a DOS prompt write:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow">AT 04:00 /every:M,T,W,TH,F,S,SU c:\tools\backup.cmd</div></pre><!--END_DEVFMTCODE--></p>
<p>Which means, that the script backup.cmd will be execute every day at 04:00. If you want to stop the scheduled job, simply perform an AT without parameters to get the ID and then afterwards make a AT ID /DELETE.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.byllemos.com/2006/05/zip-files-in-a-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

