home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC-Online 1999 November
/
PCOnline_11_1999.iso
/
filesbbs
/
OS2
/
DFSEE305.ZIP
/
DFSINFO.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-02-22
|
5KB
|
160 lines
/* Analyse current status of all physical disks, JvW 22-02-99 */
/* partition tables and partition format information */
/* Then, for all HPFS partitions, show basic information */
/* and find the Root-directory and Codepage info without */
/* using the superblock or spareblock pointers */
/* All results will be contained in the logfile DFSINFO.TXT */
/* */
/* JvW 22-11-97 Updated for sync with DFS 2.50 (dfs_number) */
/* JvW 14-12-97 Updated for sync with DFS 2.53 (FAT stuff) */
/* JvW 19-04-98 Updated more... and added first NTFS stuff; minor fixes */
/* JvW 22-02-98 Updated 'dir' discarding DIRCMD; added 'part ++' and 'map' */
Parse Source with . myself .
Parse Arg logname
if logname = '' then
do
logname = 'dfsinfo.txt'
end
if Address() <> 'DFS' then
do
Address cmd '@dfs runq' myself logname
end; else
do
Address cmd '@del' logname
'@log' logname
'more 0' /* prevent more... pausing */
say date('E') time()' : Gathering diagnostic information; Please wait ...'
say ''
'close' /* release physical disks */
say date('E') time()' : ' ||,
'First get the standard available stuff ...'
'cmd fdisk /query'
'cmd setboot /query'
say date('E') time()' : ' ||,
"And when available, Doug's partition overview too!"
'cmd chkpart'
say date('E') time()' : ' ||,
'Now use our own built-in diagnostic power ...'
'part'
'map'
'part $*'
'disk 0'
physdisks = dfs_number /* get number of disks */
say 'dfs_number: ' dfs_number
do i=1 to physdisks
Say ''
Say 'MBR/EBR chain for disk nr' i
'walk' i /* select next disk and show */
end /* it's MBR/EBR chain */
'part ++' /* show max partition info */
partitions = dfs_number /* and remember the count */
say date('E') time()' : ' ||,
'dfs_number: ' dfs_number
do i=1 to partitions
'part' i /* select next partition */
Say ''
say date('E') time()' : ' ||,
'Working on partition' i '=' dfs_drive 'on disk' dfs_disknr
if substr(dfs_drive,2,1)=':' & translate(dfs_drive) == dfs_drive then
do
Say ''
Say 'Running CHKDSK on the partition ...'
'chkdsk' dfs_drive '< dfsinfo.inp'
Say ''
Say 'Attempt a normal directory of its root directory'
'set dircmd=' /* discard DIRCMD like /P */
'dir' dfs_drive'\'
end
Say ''
select
when substr(dfs_afsys,1,4) = 'HPFS' then
do
if translate(dfs_drive) == dfs_drive then
do
Say "Running Doug's HVA if available ..."
'hva -e -r -s' dfs_drive'\*'
end
Say ''
say date('E') time()' : ' ||,
'Running some DFS HPFS diagnostics ...'
'check'
'0'
't H'
' '
' '
' '
'11'
't H'
' '
' '
'0'
'\'
' '
' '
' '
'0'
'f c'
' '
'dirmap'
'alloc'
end
when substr(dfs_afsys,1,4) = 'NTFS' then
do
say date('E') time()' : ' ||,
'Running some DFS NTFS diagnostics ...'
' '
if translate(dfs_drive) == dfs_drive then
do
'0'
' '
' '
' '
' '
' '
' '
' '
' '
' '
' '
end
end
when substr(dfs_afsys,1,3) = 'FAT' then
do
say date('E') time()' : ' ||,
'Running some DFS FAT diagnostics ...'
' '
if translate(dfs_drive) == dfs_drive then
do
'x'
'alloc'
'fatshow'
end
end
otherwise
say date('E') time()' : ' ||,
'No specific diagnostics for filesystem' dfs_afsys '(yet).'
't H'
end
end
say date('E') time()': Gathering diagnostic information finished.'
'@log' /* close the log file */
end
exit 0