set S1=current source dir and all its sub directory names
set "T1=C:\Utility\DOSBox-X\BatchBox"
a dir name "0" is the current source dir name
0\1\
0\2D\
0\3D\
0\CALCULUS\
0\FFT\
0\FFT1\
0\UTILITY\
0\UTILITY\ALARM
0\1\
.
.
till about 100 directories
i want to create batch names like below
it adds a "T" on TWO INITIAL bytes of each directory name
T2D.bat
T3D.bat
TCA.bat
TFF.bat
(TFF1.bat can not overwrite, it must be bypassed, there are only few overlapping names and i will do them manually and they will stay that way, and be untouched by the next batch process)
TUT.bat
TAL.bat
TSC.bat
TGE.bat
SET Drive=C
T2D.bat gets to be written to be like this
@echo off
cd\
CD %Drive%:\0\2D
HELLO.EXE
TFF.bat ...and the same
@echo off
cd\
CD %Drive%:\0\FFT
HELLO.EXE
if the target dir has a TFF.bat then simply bypass the process for TFF1.bat
if a dir name is less then 2 bytes, then use 1 byte
T1.bat
@echo off
CD\
CD %Drive%:\0\1
HELLO.EXE
then
it writes T2D.bat,T3D.bat,TCA.bat,TFF.bat,TUT.bat,TAL.bat.....all to the target dir %T1%
must overwrite
PS: why does a directory name "0" control so many critical files for me? this is an old DOS, i could barely afford a path length 128 bytes long. DOS matlab back in the day, it didnt use 512 bytes even it was set as, it truncated it after 128
recursive dir name reading to make dir named batches(only 2 bytes used from reading)
Moderator: DosItHelp
-
- Posts: 242
- Joined: 04 Mar 2014 11:14
- Location: germany
Re: recursive dir name reading to make dir named batches(only 2 bytes used from reading)
Hallo (nm)³,
Do you absolutely want to name the batch with the first two characters of the folder name, even though there may be name collisions because there are also three-letter names and the first two combinations occur several times?
Perhaps this can be better avoided by using the first and last letter of the folder name.
In general, however, I wonder why exactly the same content is in the batch for each folder, although the only difference in the batch is the folder name.
Something like this could be solved with a parameter transfer.
What exactly forces you to use this naming convention?
Phil
Do you absolutely want to name the batch with the first two characters of the folder name, even though there may be name collisions because there are also three-letter names and the first two combinations occur several times?
Perhaps this can be better avoided by using the first and last letter of the folder name.
In general, however, I wonder why exactly the same content is in the batch for each folder, although the only difference in the batch is the folder name.
Something like this could be solved with a parameter transfer.
What exactly forces you to use this naming convention?
Phil
Re: recursive dir name reading to make dir named batches(only 2 bytes used from reading)
>What exactly forces you to use this naming convention
my simple DOS path goes like this
path =C:\;C:\Batch;
C:\Batch contains about 200 batches
T stands for True Basic(TB) in a batch name
i have more than a 1000 of Tbasic files i wrote plus about 1000 numerical subroutines i could barely find where they are now, another 500files from TB company, it is too many to track them (but XTree and ZTree's search string help so much), so i put them in many different dirs
i type
C:\>TRK it triggers
D:
cd\
CD D:\0\RKF
HELLO.EXE ( this one is at D: or C: root)
then hello.exe can run in where Runge Kutta Felhberg algorithms are at
then i type
C:\TEI
then it goes to where EIgenvalue algorithms are
typing 3 letter batch words was ideal for me.
batches in DOS machines have different path names from ones in the dosboxx
dosboxx uses all the CTRL key combos for its own purpose so i might not be able to use dosboxx forever, my TB is limping there (the worst of it all is i cant use contrl-break to stop it from running, must close the dosboxx )
i still write programs in DOS, for numerical analysis, DOS is the best environment for me. i could port them to unix or windows anywhere once things were finished
and it was about time for me to make these batch shells from the beginning, if operable, i could be also free from changing batch names by renaming or creating new dir names by making new math algorithms
i finished this batch yesterday, and i found out that i could not filter out RKF from RKF1 (less important) and RKF2, about 13% of names overlapped but i can use TRK. TRKK and TRKKK were manually created and added
TRKKK.bat has RKF sub (most important)
TRKK.bat has now RKF1 sub (less important)
TRK.bat has now RKF2 sub (maybe new trial algo or no important, or backup)
i will adapt these, better than fixing and chasing and making path name batches frequently
my simple DOS path goes like this
path =C:\;C:\Batch;
C:\Batch contains about 200 batches
T stands for True Basic(TB) in a batch name
i have more than a 1000 of Tbasic files i wrote plus about 1000 numerical subroutines i could barely find where they are now, another 500files from TB company, it is too many to track them (but XTree and ZTree's search string help so much), so i put them in many different dirs
i type
C:\>TRK it triggers
D:
cd\
CD D:\0\RKF
HELLO.EXE ( this one is at D: or C: root)
then hello.exe can run in where Runge Kutta Felhberg algorithms are at
then i type
C:\TEI
then it goes to where EIgenvalue algorithms are
typing 3 letter batch words was ideal for me.
batches in DOS machines have different path names from ones in the dosboxx
dosboxx uses all the CTRL key combos for its own purpose so i might not be able to use dosboxx forever, my TB is limping there (the worst of it all is i cant use contrl-break to stop it from running, must close the dosboxx )
i still write programs in DOS, for numerical analysis, DOS is the best environment for me. i could port them to unix or windows anywhere once things were finished
and it was about time for me to make these batch shells from the beginning, if operable, i could be also free from changing batch names by renaming or creating new dir names by making new math algorithms
i finished this batch yesterday, and i found out that i could not filter out RKF from RKF1 (less important) and RKF2, about 13% of names overlapped but i can use TRK. TRKK and TRKKK were manually created and added
TRKKK.bat has RKF sub (most important)
TRKK.bat has now RKF1 sub (less important)
TRK.bat has now RKF2 sub (maybe new trial algo or no important, or backup)
i will adapt these, better than fixing and chasing and making path name batches frequently