{smcl}
{*! 17Jan2008}{...}
{* 06Nov2003}{...}
{hline}
help for {hi:shortdir} {right:manual:  {hi:[R] none}}
{right:dialog:  {hi: none}    }
{hline}


{title:Returns the short directory name in `r(shortdir)'}

{p 8 17 2}{cmd:shortdir} 
{it:using}{it:"directory path"}
[{cmd:,} {cmdab:sh:ort}]{p_end}

        
{title:Description}

{p 4 4 2}{cmd:shortdir} is designed for programmers using Stata on the Windows 
operating system who want to know what the short directory 
name (a.k.a. "8.3" name) that DOS names a directory when it contains spaces in the name or
has more than 8 characters in the name.  This command only works in Windows because it
shells out to a DOS prompt in order to get the short directory name that Windows came
up with.  The formula "Take the first 6 non-space characters and add '~1'" to the directory
name does not reliably work in all situations.{p_end}

{title:Examples}

{p 4 8 2}{cmd:shortdir "c:\Documents and Settings\dan\Local Settings\temp"}{p_end}

{p 4 8 2}returns in {cmd:r(shortdir)}:{p_end}

{p 4 8 2}{cmd:"c:\Docume~1\dan\LocalS~1\temp"}{p_end}

{p 4 8 2}{cmd:shortdir "c:\Documents and Settings\dan_blanchette\Local Settings\temp"}{p_end}

{p 4 8 2}returns in {cmd:r(shortdir)}:{p_end}

{p 4 8 2}{cmd:"c:\Docume~1\dan_blanchette\LocalS~1\temp"}{p_end}

{p 4 8 2}since "dan_blanchette" has no spaces in the name.{p_end}

{p 4 8 2}{cmd:shortdir "c:\Documents and Settings\dan_blanchette\Local Settings\temp", short}{p_end}

{p 4 8 2}returns in {cmd:r(shortdir)}:{p_end}

{p 4 8 2}{cmd:"c:\Docume~1\dan_bl~1\LocalS~1\temp"}{p_end}

{p 4 8 2}since "dan_blanchette" is longer than 8 characters.{p_end}


{title:Saved Results}

{p 4 4 2}The {cmd:shortdir} command saves in {cmd:r()}:{p_end}
 
{synoptset 20 tabbed}{...}
{p2col 5 20 24 2: Macros}{p_end}
{synopt:{cmd:{cmd:r(shortdir)}}the directory path.{p_end}


{title:Author}

{p 4 4 2}
Dan Blanchette {break}
Center of Entrepreneurship and Innovation {break}
Duke University's Fuqua School of Business {break}
Dan.Blanchette@Duke.edu{p_end}


{title:Also see}

{p 4 13 2}On-line: {help tempfile} {help _getfilename} ,
{help confirmdir} (if installed)
{help tmpdir} (if installed){p_end}



