home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Pier Shareware 6
/
The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso
/
035
/
perf31.zip
/
perf_30
/
MMD.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-01-06
|
3KB
|
75 lines
/* Make Multiple Directories*/
/*Copyright (c) 1993 CLEAR & SIMPLE, INC.*/
ECHO OFF
arg directory cmd
if directory='' then do
echo on
'prompt $p$E[0;'34';'47';'4';'4'm]'
echo off
'cls'
red ='
A'
green ='
A'
yellow ='
A'
blue ='
A'
white ='
A'
say 'MMD (Make Multiple Directory) was written to be executed from the command line.'
say;say ' Its format is: MMD d:\dir\sub1\sub2 [Y] '
say ' Where d:\dir\sub1\sub2 is the fully qualified directory path to be created';
say ' And Y is an option to create the directory without any dialog. '
say ''
say;say 'Enter fully qualified directory now?'
pull directory
if directory ='' then Exit
Say; say 'Do you want MMD to skip dialog during creation?'
say 'Enter Y for yes (any other key will answer no)'
parse upper value sysgetkey()with cmd;say
end
parse upper var cmd cmd
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
pos=pos('"', directory)
If pos\=0 then directory=strip(directory,'B','"')
pos=pos("'", directory)
If pos\=0 then directory=strip(directory,'B',"'")
parse var directory drive '\' s.1 '\' s.2 '\' s.3 '\' s.4 '\' s.5 '\' s.6 '\' s.7 '\' s.8 '\' s.9 '\' s.10 '\' s.11 '\' s.12 '\' s.13 '\' s.14 '\' s.15 '\' s.16 '\' s.17 '\' s.18 '\' s.19 '\' s.20
madenew=0
i=1
newdir=drive
do while s.i \=''
newdir=newdir'\'s.i
rc=SysFileTree(newdir,dest,'DO');
if dest.0=0 then do /*make a new directory*/
if cmd \= 'Y' then do
say 'The path 'newdir 'does not exist'
say 'Do you want the path created?'
Say 'Answer Y to continue.'
parse upper value sysgetkey() with answ;say
if answ \= 'Y' then exit
end
madenew=1
rc=SysMkDir(newdir)
Select
when rc=3 then do;call notsound;say 'Incorrect Format';call sayend;exit;end
when rc=5 then do;call notsound;say 'Access is denied to drive or path';
say 'Please free resource and try again';call sayend;exit;end
when rc=206 then do;call notsound;say 'Directory name is too long';
say 'Shorten name - 'newdir; say ' or use an HPFS Drive'; call sayend;exit;end
when rc\=0 then do; call notsound; say 'Error making directory - please retry'; call sayend;exit; end
otherwise;
end
end /*make a new directory*/
i=i+1
end
if cmd \= 'Y' then do
if madenew then say 'Made the new directory structure' newdir
else say 'The directory structure' newdir 'already existed!'
end
return madenew
sayend: say;say 'Press any key to end...';key=sysgetkey();return
notsound:
call beep 262,200
call beep 60,700
return