home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 June
/
PCWorld_1998-06_cd.bin
/
software
/
sharware
/
utility
/
PACKERS
/
JAM
/
SHRINK.BAT
< prev
Wrap
DOS Batch File
|
1995-03-09
|
2KB
|
69 lines
@echo off
rem JAM R1.20, SHRINK.BAT -- automatically reduces a JAM drive.
rem Sun Jul 10 1994, written by George A. Reznik.
rem Copyright (c) 1992-1994 JAM Software.
rem All Rights Reserved.
echo SHRINK 1.20 Copyright (c) JAM Software, 1992-1994. All rights reserved.
echo:
if "%1" == "" goto usage
if not "%1" == "/?" goto getinfo
:usage
echo Automatically reduces the size of a JAM drive.
echo Use:
echo SHRINK drive: [size]
echo Where:
echo drive JAM drive to shrink
echo size Specifies amount of physical space (in Kbytes)
echo on which JAM drive should be shrunk.
echo If not specified the maximum possible value is used.
echo Example:
echo SHRINK D: -- reduce the size of JAM drive D:
echo Note:
echo Do not run this batch file from the drive you want to shrink.
goto end
:getinfo
jmount /q %1 > shrink2.bat
if errorlevel 1 goto end
if not exist shrink2.bat goto cerror
echo Building secondary command file ...
echo if not "%%4" == "available" goto chkflags > jam.bat
echo echo JAM drive %%2 not mounted. >> jam.bat
echo goto end >> jam.bat
echo :chkflags >> jam.bat
echo if not "%%5" == "[Locked]" goto defrag >> jam.bat
echo echo JAM drive %%2 locked. >> jam.bat
echo goto end >> jam.bat
echo :defrag >> jam.bat
echo echo Defragmenting JAM drive %%2 ... >> jam.bat
echo jmax /q %%2 >> jam.bat
echo if errorlevel 1 goto end >> jam.bat
echo echo Deactivating JAM drive %%2 ... >> jam.bat
echo jmount /q /d %%2 >> jam.bat
echo if errorlevel 1 goto end >> jam.bat
echo echo Shrinking the size of %%4 ... >> jam.bat
echo jsize /q %%4 -%2 >> jam.bat
echo if errorlevel 1 goto end >> jam.bat
echo echo Remounting JAM drive %%2 ... >> jam.bat
echo jmount /q /m %%2 %%4 >> jam.bat
echo :end >> jam.bat
if exist jam.bat goto run
:cerror
echo Cannot create a file on current drive.
goto end
:run
call shrink2.bat
del shrink2.bat
del jam.bat
:end