Horst's
English German


Don't follow leaders
Horst Schaeffer's Software Pages
VARSET 1.2 Set variables ... Download (9Kb)
VARSET sets variables with various file related information, and offers integer arithmetic and string operations. Long file names are supported under Win 9x/2000/XP (not under NT).

The syntax is easy to remember, e.g.:     call var set FD=date of filename.ext

To set the environmental variable a SET instruction is generated, and automatically executed through the CALL VAR SET .. construct (this also works under Win NT/2000).

DATE, TIME Date/time tag of given file (name), or current date/time
FILES, DIRSNumber of files/directories (wildcards)
SIZE Size of file(s), wildcards supported, bytes, Kb or Mb
LINESNumber of lines (ASCII file assumed)
VOL Volume label for given drive letter
DRIVE, -DRIVEExtract or remove drive from given filespec
NAME File name without path and extension
EXT, -EXT Extract or remove extension
LFN, SFN Long/short file name (with full path)
FULL Complete file name with full path

STRING(p,l)

Substring (position, length)
(expression) Integer calculation

Options: Change upper/lower case, right aligned strings, leading zeros, thousands separators.
 
VARGET 1.2 Get assignments from INI file Download (5Kb)
With VARGET you can get assignments from a (Windows style) INI file, and make them available as environmental variables. Section names are supported.

Example:     call var get [desktop]wallpaper from %windir%\WIN.INI

To generate the variables VARGET uses the same CALL VAR construct as VARSET.COM (Win 2000/XP compatible). Several assignments can be extracted with a single command.

Example:     call var get MAIL,SOURCE,ADDRESS from XJOB.INI

VARGET offers an easy way to use INI files for your own batch projects. To save environmental space you can activate variables only when you need them.

See also: IniFile (DOS), IniFile (32bit)
LMOD 1.3 Line & List Modification Download (12Kb)
LMOD extracts data from an input source (STDIN): from redirected DOS screen output, for example, or from any (ASCII) file. The extracted information is inserted into a given text or command string, and sent to STDOUT for redirection into a file.

You may extract a complete line, a part of it (starting column, size) or words (by number), even several items from a source line in any order. And this will be done either for a single line, or for a given range of lines of the input source.

What you can do with LMOD:
  • set environmental variables with information from (DOS) screen output
  • get keyboard input
  • generate a command using extracted input data
  • generate a list of commands for each item of a given (file) list
  • extract (and modify) range of lines from a file
  • modify lists or tables, arrange columns
To set a variable: generate a SET command (or WINSET / SETX), and execute it thru a temporary batch file. This method also works under Windows NT/2000.

Special Features:
  • change case for extracted data
  • tabs (to given column) for formatted output
  • right aligned fields (numeric data in tables)
  • insert CR+LF to generate several lines for each input line
  • omit CR+LF at end of output (to append later)
  • insert line number (to generate filenames, for example)
  • insert special characters by code number or in quoted string
ISDATE 2.4 Compare Dates Download (3Kb)
IsDate compares two dates, including date tags of files and directories, TODAY. Date format acc. to COUNTRY. Optional difference (plus/minus days).

Example:   IsDate  C:\arc\foo.txt  before  today-7

The result (TRUE/FALSE) is returned by errorlevel.

Features:
  • LFN support (Win9x/2000/XP)
  • Comparison operators: [not] =, equal, before, after
  • Default or custom date format
  • Internal calculation of day count since Jan 1, 1901 (up to 2079)
32 bit Windows command line tool: WasFile.exe
WCLIP 2.2 WINDOWS Clipboard Tool for DOS Download (3Kb)
WCLIP sends redirected/piped DOS text to the WINDOWS clipboard.

Example: DIR | WCLIP

It also reads from the clipboard, sending the text to STDOUT (for redirection to a file).

Extended ASCII characters are converted according to the country specific "OEM" font.

Options:
  • Append to current text in clipboard (default: overwrite)
  • T-Pipe: send text to the screen as well (STDOUT)
WCLIP runs in a DOS box under WIN95/98 (not under NT/W2K/XP)

32 bit Windows command line tool: ClipText.exe
FIND 2.3 FIND Tools Download (9Kb)
XFIND scans files for a string (optionally in all subdirectories), and reports all files where the string was found.

Example:   XFIND "anything" C:\some\where\*.TXT *.DOC *.ASC /s > result.txt

Features:
  • Any file type can be scanned; string may include decimal ASCII codes
  • Several file name patterns (wildcards) supported
  • Reported files optionally with relative path (i.e. only subdirectory names),
    or with LFN's (relative or full path)
  • Output lines can be prefixed with custon string
  • Case ignored by default, case sensitive search by option

TFIND scans a single file, and reports all lines where the given strings were found (Boolean AND).
A FOR loop can be used to scan several files.

Example:   TFIND "this" "that" TEST.TXT > result.txt

Features:
  • The search can be limited to a field in a fixed field (column oriented) list
  • Alternative errorlevel with number of hits (max. 254)
  • Input file from STDIN supported
  • Inverted output (all lines without hits)
  • Line size up to 2Kb; file size not limited
  • File name headers (with specified or relative path, LFN's) only by option; custom prefix;
  • Special search mode where only letters and digits are relevant (option)
  • Case ignored by default, case sensitive search by option
Notes: LFN's supported under Win9x/2000; Upper/lower case table can be patched thru Debug script
INIFILE 1.2 INI File Read/Write Download (5Kb)
INIFILE handles Windows type INI files with section names in square brackets, and assignments of the form: item=string. INI files without sections are also supported. Maximum file size is 60Kb.

Syntax:
 
INIFILE filename [section] item=string change or write
INIFILE filename [section] item= remove item
INIFILE filename [section] /remove remove entire section
INIFILE filename [section] item > temp.bat read item
INIFILE filename [section] > temp.bat read section

Items, sections, and INI files are generated if not found. When an item is removed, the section will also be removed if no items are left.

Reading an assignment sends a SET statement to STDOUT for redirection to a temporary batch file.

Not supported in this version:
  • multiple items with same name in same section (only the first occurrence will be found)
  • handling of multiple (comma separated) assignments for an item (only the complete string is read or written)
32 bit Windows command line tool: IniFile.exe