@echo off&set FileName=%~n0&shift :: ============================================= :: AutoHelp PlugLab Concept: 2006 by Reatogo :: ============================================= :: Help Info: :: ======================= set Routine_Type=1 :: 1=Getting Data 2=Prompts 3=Getting Files 4=Creating Files 5=General set Routine_Vers=1 set Routine_Date=2007-02-15 set RoutineName=DriveSpaceFree set RoutineAuthor=Siegfried set Using_work_from= set Example_call_1=%%DriveSpaceFree%% "%%SystemDrive%%" set Example_call_2=%%DriveSpaceFree%% "%%CD%%" set Example_call_3=%%DriveSpaceFree%% "%%~dp0" set text_01=Checks for the free space and the total capacity of a drive. set text_02=. set text_03=Parameter 1 may be the drive like "C:" or "C:\" or any path to a directory on a drive. set text_04=A file path also works. The resulting "%%Drive%%" from an internal call on "%%SplitPath%%" will be used so any valid path on a drive works. set text_05=. set text_06=Returns: set text_07=%%result%% with the free space in Mb, e.g. "1405" set text_08=%%result2%% with the total capacity in Mb, e.g. "19120" set text_09=Returns "" if the drive does not exist. set text_10=. set text_11=Usage on the CD: - if xFUNCs.exe is in system32 - set text_12=Put the following code into your script. Returns the same as above. NOTE: A file path does not work for a direct call on xFUNCs.exe. set text_13=. set text_14=xFUNCs "DriveSpaceFree" "C:" set text_15=. set text_16=if exist "%%temp%%\TempLab.cmd" ( set text_17= call "%%temp%%\TempLab.cmd" set text_18= del "%%temp%%\TempLab.cmd" set text_19=) if "%~1" == "GetHelp" goto :EOF echo.&echo %* :: ============================================= set DriveSpaceFreePath=%~1 if "%DriveSpaceFreePath:~-1%" == ":" goto noSplit %SplitPath% "%~1" "s" set DriveSpaceFreePath=%Drive% :noSplit "%APPs%\xFUNCs.exe" "DriveSpaceFree" "%DriveSpaceFreePath%" if exist "%temp%\TempLab.cmd" ( call "%temp%\TempLab.cmd" del "%temp%\TempLab.cmd" ) set DriveSpaceFreePath= echo RESULT is "%result%" RESULT2 is "%result2%" goto :EOF