Microsoft KB Archive/97928

= CONVERT.BAT and GETPATH.BAT File Contents =

Article ID: 97928

Article Last Modified on 11/21/1999

-

APPLIES TO


 * Microsoft MS-DOS 6.0 Standard Edition

-



This article was previously published under Q97928



SUMMARY
CONVERT.BAT and GETPATH.BAT are two batch files included with the Stacker Conversion disk. The contents of these files are listed below.



CONVER.BAT
@echo off if &quot;%1&quot;==&quot;/?&quot; goto givehelp if &quot;%1&quot;==&quot;?&quot; goto givehelp if &quot;%1&quot;==&quot;-?&quot; goto givehelp if &quot;&quot;==&quot;%1&quot; goto findit if &quot;&quot;==&quot;%2&quot; goto stacdir if not exist %2 goto Invalid_args goto signon REM  if Stacker is in default location, handle automatically.
 * stacdir

if exist c:\stacker\check.exe CONVERT %1 c:\stacker\check.exe if exist c:\stacker\scheck.exe CONVERT %1 c:\stacker\scheck.exe REM  else search the path... echo Searching for your Stacker directory... call getpath check.exe if &quot;%TARGET%&quot;==&quot;&quot; call getpath scheck.exe if &quot;%TARGET%&quot;==&quot;&quot; goto cantfindstacker CONVERT %1 %TARGET%
 * findit

REM Check to ensure we have enough environment space for a full path (80 chars) set TEST1= set TEST2= if not &quot;%TEST1%&quot;==&quot;&quot; goto smallenv if not &quot;%TEST2%&quot;==&quot;&quot; goto smallenv set TEST1= set TEST2= if &quot;%temp%&quot; == &quot;&quot; set temp=c:\ REM if temp is set to non existent dir, point to root of c. if not exist %temp%\NUL set temp=c:\ REM Confirm that CONVERT is in the working directory. if not exist .\convert.bat goto notroot if not exist .\getpath.bat goto notroot if not exist .\allstack.exe goto notroot if not exist .\dblspace.hlp goto notroot if not exist .\dblspace.exe goto notroot if not exist .\convert.txt goto notroot echo Searching for the directory that contains your MS-DOS files... call getpath dblspace.exe if &quot;%TARGET%&quot;==&quot;&quot; goto nodblspace CONVERT %TARGET%
 * signon

if not exist %1 goto Invalid_args cls echo Welcome to the MS-DOS Stacker conversion program. echo. echo This program copies an updated version of the DBLSPACE.EXE file echo to your hard disk and checks your drive(s) for errors. Then echo it runs the updated DoubleSpace program to convert your Stacker echo drive(s) to DoubleSpace format. echo. echo NOTE: The conversion process can take several hours. echo.
 * readdocs

echo The CONVERT.TXT file contains a detailed procedure for running echo this program. echo. choice /cync /n &quot;Do you want to read the CONVERT.TXT file now [Yes,No,Cancel]?&quot;
 * displayfile

if errorlevel 3 goto cancelexit if errorlevel 2 goto skipdocs more < convert.txt echo. choice /cync /n &quot;Would you like to read CONVERT.TXT again [Yes,No,Cancel]?&quot; goto displayfile
 * skipdocs

CLS echo. echo Updating the DBLSPACE.EXE and DBLSPACE.HLP files... attrib -r -h -s %1 > nul call getpath dblspace.hlp if not &quot;%target%&quot; == &quot;&quot; copy dblspace.hlp %target% > nul copy dblspace.exe %1 > nul cls echo. echo Now running the SCHECK or CHECK programs and the CHKDSK program echo to check your drive(s) for errors. echo. echo DoubleSpace Setup will later warn you that you need to run SCHECK echo or CHECK before converting Stacker drives to DoubleSpace. Because echo this program is doing that now, you can ignore the warning. echo. echo Watch carefully and note any errors that are reported. echo. pause allstack %2 /F #c: allstack chkdsk /F #c: allstack -h chkdsk /F #c:

choice /n &quot;Were any errors reported [Yes,No]?&quot; if errorlevel 2 goto OK goto fixerrors
 * OK

cls echo. echo DoubleSpace Setup will now convert your Stacker drives to echo DoubleSpace format. This will take several hours. echo. choice /n &quot;Do you want to convert your Stacker drive(s) now [Yes,No]?&quot; if errorlevel 2 goto userabort cls echo. echo Press ENTER at the DoubleSpace Setup Welcome screen to begin echo converting your Stacker drives. echo. echo Loading DoubleSpace Setup... choice /ty,5 /n >nul %1 goto exitprogram


 * fixerrors

echo. Echo  The MS-DOS Stacker conversion program cannot continue echo  because your drive(s) still contain disk errors. echo. echo  Before converting your drives, you must fix all disk errors. echo  For information about fixing disk errors, see the MS-DOS 6 echo  User's Guide and your Stacker documentation. After fixing echo  the errors, run CONVERT again. echo. goto exitprogram


 * nodblspace

Echo  The MS-DOS Stacker conversion program cannot continue echo  because it could not find your copy of the DBLSPACE.EXE file. echo  The DBLSPACE.EXE should be located in the directory that echo  contains your MS-DOS files. echo. echo  Add your MS-DOS directory to your search path, and then run echo  CONVERT again. (For information about changing your search echo  path, type HELP PATH at the command prompt.) goto exitprogram


 * Invalid_args

Echo. Echo  The MS-DOS Stacker conversion program cannot continue echo  because the CONVERT command included an invalid argument. echo. echo  To run the Stacker conversion program, type CONVERT at the echo  command prompt without any arguments, and then press ENTER. echo. goto exitprogram


 * cantfindstacker

Echo. Echo  The MS-DOS Stacker conversion program cannot continue echo  because it cannot find the Stacker CHECK.EXE or SCHECK.EXE echo  programs. echo. echo  Add the directory that contains your Stacker files to your echo  search path, and then run CONVERT again. Either the CHECK.EXE echo  or the SCHECK.EXE file must be in your Stacker directory when echo  you run CONVERT. (For information about changing your search echo  path, type HELP PATH at the command prompt.) echo. goto exitprogram


 * smallenv

set TEST1= set TEST2= Echo. Echo  The MS-DOS Stacker conversion program cannot continue Echo  because there is not enough environment space. echo. Echo  Use the SET command to examine your environment, and to echo   remove any unnecessary environment variables. echo. goto exitprogram


 * notroot

Echo. Echo  The MS-DOS Stacker conversion program cannot continue Echo  because it cannot find one of its component files. echo. Echo  Change to the drive and directory that contains the echo  CONVERT.BAT file, and then run CONVERT again. For example, echo  if the MS-DOS Stacker conversion disk is in drive B, echo   you would type the following: echo. echo      B: echo       CONVERT echo. goto exitprogram


 * userabort

echo. echo  The Stacker conversion process has been canceled. echo. echo  To convert your Stacker drives, run CONVERT again. When echo  CONVERT displays the question &quot;Do you want to convert echo  your Stacker drive(s) now?&quot; type Y. echo. goto exitprogram


 * givehelp

echo  The CONVERT program converts your Stacker drives to DoubleSpace echo  format. When the conversion process is complete, all your echo  Stacker drives will be DoubleSpace drives. echo. echo  CONVERT replaces the DBLSPACE.EXE file in your MS-DOS directory echo  with an updated version of DBLSPACE.EXE. After CONVERT checks echo  your drive(s) for errors, it runs the updated DoubleSpace echo  program to convert all your Stacker drives. echo. echo  To convert your Stacker drives to DoubleSpace drives, type echo  CONVERT at the command prompt without any arguments, and then echo  press ENTER. goto exitprogram


 * cancelexit

echo. echo  The MS-DOS Stacker conversion process has been canceled. echo  To convert your Stacker drives to DoubleSpace drives, echo  run the CONVERT program again. echo.
 * exitprogram

set TARGET=

GETPATH.BAT ---

@echo off rem

rem GETPATH -- Searches for a (wildcarded if you like) file along the rem           path rem           sets the environment variable &quot;TARGET&quot; to a full rem           specification for the file rem rem format:  GETPATH  filename.ext rem rem return:  %TARGET% == full specification, or &quot;&quot; rem

if &quot;%1&quot;==&quot;&quot; goto help

set TARGET= if exist zz.bat del zz.bat

rem if exist %1 goto localdir  --don't check for a local copy of the file!

echo @ECHO OFF                                  >zz.bat echo;                                          >>zz.bat echo if &quot;%%1&quot;==&quot;&quot; goto loop                    >>zz.bat echo;                                          >>zz.bat echo if not &quot;%%START%%&quot;==&quot;TRUE&quot; goto end       >>zz.bat echo if exist %%1\%1 set TARGET=%%1\%1         >>zz.bat echo if not &quot;%%TARGET%%&quot;==&quot;&quot; set START=FALSE   >>zz.bat echo;                                          >>zz.bat echo goto end                                  >>zz.bat echo;                                          >>zz.bat echo :loop                                     >>zz.bat echo set START=TRUE>>zz.bat echo for %%%%f in (%%PATH%%) do call zz %%%%f>>zz.bat echo set START=>>zz.bat echo;                                          >>zz.bat echo :end                                      >>zz.bat echo;                                          >>zz.bat

call zz.bat del zz.bat goto end


 * localdir

set TARGET=%1 goto end


 * two

echo PARAM %1


 * help

echo format: GETPATH filename.ext echo; echo examine the environment variable TARGET= after running getpath. echo; goto end


 * end

Additional query words: 6.00 translate convert getpath

Keywords: KB97928

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.