home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
EAGONE.ZIP
/
EAGONE.CMD
Wrap
OS/2 REXX Batch file
|
1991-06-22
|
4KB
|
142 lines
/*
EA remover/browser for entire drive
by Mike Nice [73565,565]
June 1991
Did you ever have your EA DATA. SF file on the C: drive grow to over
a 500 K after installing OS/2 1.3? The installation procedure added
Extended Attributes (EAs) to all .COM and .EXE files on that drive.
See the file EADAT2.TXT in the MSOPSYS forum for more details.
Removing EAs manually from all directories is tedious since EAUTIL operates
on only one file at a time. This program will remove EAs from all .COM and
.EXE files on the specified drive.
Usage: EAGONE d: EaSize
Where d: is drive to remove Extended Attributes from
Where EaSize = size of Extended Attributes to remove from
.COM and .EXE files
(Only Extended Attributes of EXACTLY that size will be removed)
To find out the size of EA to remove, go to the \OS2 directory and
do a DIR /N. The .EXE files will have the size of the extended
attribute as the second number. This should be a small number,
about 55 bytes. Extended Attributes should not be removed from other
files unless you are know for sure that they are unnecessary.
CAUTION: These extended attributes do not seem to be necessary under
OS/2 version 1.3 and below. There is no guarantee that they
are not necessary on a future version. Use this program at
your own risk.
NOTE: If you have the Utility SHOWEA (FROM ZNT:PROGRAMMING),
you may choose to modify the code below to log all files
containg EAs first and browse the logfile to be sure it
is safe to proceed. Or out of curiosity to see what other files
have EA's, use SHOWEA to log only the files which were not
modified.
*/
ARG CMDLINE
SAY "Extra EA remover"
IF LENGTH(CMDLINE)=0 THEN SIGNAL Help
PARSE ARG Drive expectedSize
IF LENGTH(Drive)\=2 THEN SIGNAL Help
IF LENGTH(expectedSize)=0 THEN SIGNAL Help
IF (DATATYPE(expectedSize)\="NUM") THEN SIGNAL Help
IF expectedSize=0 THEN SIGNAL Help
DirListFile="Dir$li$t.DAT"
EALogFile="EAFiles.LOG"
Say "Finding Directories on" Drive
"@TREE " Drive "| RXQUEUE"
"@if exist "DirListFile " DEL " DirListFile
/* Root directory */
CALL LINEOUT DirListFile, drive || "\", 1
DO WHILE QUEUED() > 0
PARSE PULL PathName Dir .
IF PathName="Path:" THEN DO
CALL LINEOUT DirListFile, drive || Dir || "\"
CALL CHAROUT "CON:", '.'
END
END
SAY
/* Close file */
CALL LINEOUT DirListFile
/* Check that the input file exists */
IF (STREAM(DirListFile,C,'QUERY EXISTS')="" ) THEN SIGNAL NoFile
DirName=LINEIN(DirListFile)
DO WHILE (DirName<>"")
CALL CleanDir DirName
DirName=LINEIN(DirListFile)
END
CALL STREAM DirListFile,C,'CLOSE'
SAY "Done"
SAY
"@if exist "DirListFile " DEL " DirListFile
"@if exist "EALogFile" echo NOTE: More Extended Attribute information in " EaLogFile
EXIT
CleanDir:
ARG DirName;
SAY "Searching " DirName
/* *********************
Change next line to
"@DIR /N "DirName"*.* 2>NUL | RXQUEUE"
to see all files....
********************** */
"@DIR /N "DirName"*.exe " DirName"*.com 2>NUL | RXQUEUE"
DO WHILE QUEUED() > 0
PARSE PULL date time size eaSize fileName .
IF (DATATYPE(eaSize) = "NUM") & (fileName <> "") THEN DO
IF eaSize > 0 THEN DO
IF eaSize = expectedSize THEN DO
fspec=DirName || fileName
SAY "Removing EA from " fspec
"@EAUTIL" fspec "nul /s"
/* **** LOGGING ONLY *** "@SHOWEA " fspec ">> " EaLogFile */
END
ELSE DO
fspec=DirName || fileName
SAY "EA size "eaSize " NOT removed from " fspec
/* **** LOGGING ONLY *** "@SHOWEA " fspec ">> " EaLogFile */
END
END
END
END
RETURN;
NoFile:
SAY "Unable to create/open directory listing file " DirListFile
SAY
EXIT
Help:
SAY "Usage: EAGONE d: EaSize"
SAY " Where d: is drive to remove Extended Attributes from"
SAY " Where EaSize = size of EA to remove from .COM and .EXE files"
SAY
EXIT