Installation |
Copy the program into the directory where the batch file using it will run.
To test the exit code in your batch file insert this code:
rem : Run freedrive
freedrive D m 200
rem Report exit return from freedrive
echo off
FOR %%E IN (0,1,2) DO IF ERRORLEVEL %%E00 SET ERLVL=%%E
IF "%ERLVL%"=="0" SET ERLVL=
SET RANGE=0,1,2,3,4,5,6,7,8,9
IF "%ERLVL%"=="2" SET RANGE=0,1,2,3,4,5
FOR %%E IN (%RANGE%) DO IF ERRORLEVEL %ERLVL%%%E0 SET ERLVL=%ERLVL%%%E
IF "%ERLVL%"=="0" SET ERLVL=
IF NOT "%ERLVL%"=="25" SET RANGE=0,1,2,3,4,5,6,7,8,9
FOR %%E IN (%RANGE%) DO IF ERRORLEVEL %ERLVL%%%E SET ERLVL=%ERLVL%%%E
SET RANGE=
if ERRORLEVEL 0 if not ERRORLEVEL 1 goto Next
net send me mybatch.bat : freedrive exit code = %ERLVL%.
goto Exit
:Next
rem continue
:Exit
|