DOS and VB Utilities
This is a collection of little utilities I have written over the last 6 or 7 years. In other words, once you see this stuff, you will wonder how you lived without it!
This code was written because I needed it. If you like it, then I'm glad to be of service. Most of this code has been around since DOS 3.3. It works fine under Win 3.1 and/or Win 95.
All code downloaded and used at your own risk. It all works fine on my machines. If it doesn't work on your's, that is your problem not mine <g>
This is some code that I contributed to the Infozip project, probably one of the greatest pieces of public service available on the web. Mike White of that project kindly changed the Infozip DLLs so that they could be called from Visual Basic 5. I tore most of my hair out trying to solve the problems of VB5 and C Callback logic :)
This code works on my machine, I hope it works on yours. Please do not ask me for versions of this code for VB3 and VB4. It is not possible to call these DLLs from VB3 or VB4 as neither language supports Callbacks.
DI 1.9 - Copyright (c) M. R. Le Voi Systems Consultants - Use /? for help
Syntax: DI [file1] [file2] [/[r][a][s][h][d][+][-]] [/flags]
Where : r-read only a-archive s-system h-hidden d-directories
Optional flags are :-
/c - show directories as well
/f - show matches during directory comparison
/g - backup all file1 which are different from file2 to file2
/m - match directories using copy/delete
/ma- match directories and reset archive bit on file1
/p - pause after each screen
/e - pause after each screen (ega mode)
/t - check complete disk - show tree only if no filespec
/w - use full screen window mode for display
File1 and file2 can both contain wild cards.
If file1 is omitted, *.* is assumed.
If file2 is given, the two directories will be compared.
If / is specified on its own, all attributes are matched.
If + or - are specified, the attributes are set/unset accordingly.
As you can see, this was written before DOS 5.0 and later versions of DIR got all those fancy options. However, this program still has some functions I still use.
SPLIT 1.2 - Copyright (C) M. R. Le Voi Systems Consultants - Use /? for help
Syntax: SPLIT filename [d:] [/flags]
Optional flags are :-
/nnn - maximum size of an output file in k - default 1440
/? - display this help message
If d: is omitted, A: is assumed.
The maximum number of output files is 99.
1440 is the maximum that can be specified via the /nnn switch.
How often have you had a file that won't fit on a diskette? Even after you zipped it up? SPLIT is the answer.
When the DOS BACKUP command was no good because it was DOS release dependent and PKZIP did not support diskette spanning, this was the only way to perform this action. Here is an example:
REPRO 1.1 - M. R. Le Voi Systems Consultants - Use /? for help
Syntax: REPRO <file1> <file2> [NEW|OLD|MOD] [BIN] [SKIP(xxx)] [COUNT(yyy)]
Where:-
file1 - name of input file
file2 - name of output file
xxx - number of input records/bytes to be skipped
yyy - number of input records/bytes to be written
NEW is default. If OLD is requested, output file will be overwritten unconditionally.
If MOD is requested, input data will be appended to the output file.
If BIN is specified, SKIP/COUNT are byte values.
For all MVS users out there (and for the PC community too), here is a utility I use rarely but is invaluable when you need it! Here are 2 recent examples of its use:
A Mainframe report downloaded to the PC is 3 MB in size and 30,000 lines long. You want to extract lines 9001 to 9100 and 22001 to 22050 for importing into EXCEL. The file is so big, it is impossible to edit normally. Solution:
A PC file has one spurious byte right in the middle of it which prevents UUDECODE from decoding the file. Solution:
COL 1.2 - Copyright (C) M. R. Le Voi Systems Consultants
Syntax: COL [e|v] [i] [n] [h] [N1] [N2] [/help]
Where:-
e - set 43 line EGA mode/50 line VGA mode
v - set 28 line EGA mode on VGA monitor
i - enable high intensity background
n - disable high background intensity
h - high intensity colour
N1 - foreground colour number
N2 - background colour number
Colour numbers are as follows:-
0=black 1=blue 2=green 3=cyan
4=red 5=pink 6=brown 7=white
If no numbers are specified, default is cyan on black
I don't use the colour stuff much anymore as I now use ANSI.SYS and escape sequences. However, quickly changing the DOS screen to 50 lines under VGA mode is very useful sometimes! Examples:
Written in Quick ASM. Source included for all you Assembler buffs.
No operands required. Takes 3 replies. W - warm boot. C - cold boot. Esc - Escape.
Written in ASM. Source included for all you Assembler buffs.
NOKEY 1.1 - Copyright (C) M. R. Le Voi Systems Consultants - Use /? for help
Syntax: NOKEY [parm]
Valid values for the parm are:-
/ or ? - Display this help message
0 - Enable CTRL-C and exit
1 - Disable CTRL-C and exit
other - Disable CTRL-C and CTRL-BREAK
Unless the parm is 0 or 1, NOKEY will go TSR
and disable the other selected keys.
REBOOT was needed to reboot a PC when NOKEY disabled the option! The PC group at my last place of work wanted to stop users accidently pressing ALT-CTRL-DEL or Print Screen/ALT-SYS REQUEST. I added the CTRL-C, CTRL-BREAK options as well.
Written in ASM. Source included for all you Assembler buffs.