<?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>Bohack &#187; Linux / Unix</title>
	<atom:link href="http://www.bohack.com/tag/linux-unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bohack.com</link>
	<description>Check In and Tune Out!</description>
	<lastBuildDate>Wed, 24 Feb 2010 18:55:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Windows Version of the Linux / UNIX &#8216;which&#8217; Command</title>
		<link>http://www.bohack.com/2008/11/windows-version-of-the-linux-which-command/</link>
		<comments>http://www.bohack.com/2008/11/windows-version-of-the-linux-which-command/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 19:38:26 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=137</guid>
		<description><![CDATA[During the day I always have a command window open on my desktop. It helps get simple tasks done; like reseting a password for a user or opening an ssh session with a remote box. I have a multitude of Windows command or cmd scripts that help me through out the day. Often I may [...]]]></description>
			<content:encoded><![CDATA[<p>During the day I always have a command window open on my desktop. It helps get simple tasks done; like reseting a password for a user or opening an ssh session with a remote box. I have a multitude of Windows command or cmd scripts that help me through out the day. Often I may want to change or tweak a script and then the hunt is on&#8230; Which directory was it created in? I know that it is in the path; because I can just execute it without typing it&#8217;s full path, but where is it?</p>
<p><span id="more-137"></span><br />
As best practice; I recommend to keep all scripts in a folder at the base of the %systemdrive% or C: drive and include it in your system %path% variable. This makes it easy to take your tools with you, when you redo your laptop or desktop. I personally use a folder called &#8216;sys&#8217;, but you can select your own. Just be sure to include the folder in your %path% variable.</p>
<p>Even if you put all your files in a particular folder sometimes your just looking for that particular file in the path. So I have written a Windows version of the UNIX &#8216;which&#8217; command. Just copy the script below and save it as &#8216;which.cmd&#8217; in your &#8216;sys&#8217; folder.</p>
<p>Copy and Paste the script below into notepad and save it as &#8220;which.cmd&#8221;</p>
<pre>
@echo off
rem /
rem / which.cmd - 110108 - bohack.com 2008iÂ Â Â Â  /
rem / Windows version of the UNIX which command /
rem /
setlocal
if [%1]==[] goto :errhand
set whichpath=%~dp$path:1
if [%whichpath%]==[] goto :end
echo %whichpath%%1
goto end

:errhand
echo.
echo Usage: %0 (filename to search in path)

:end
endlocal
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2008/11/windows-version-of-the-linux-which-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
