Page 1 of 2

The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 03:10
by Erik Bachmann
For years I've been looking for the ultimate DOS/Windows batch library - without much success. So I've build my own - including documentation, unit tests and examples.
The library is not a collection of snippet - like DosTips, but ready to use scripts;

The "_" Windows Batch Library (The "underscore" Windows Batch Library) is a collection of generic, ready-to-use batch scripts, that I've developed and refined over the years. Most of the script are self-made, but other sources or inspiration are mentioned in either $AUTHOR or URL tags in the scripts headers.

Experience has learned me the hard way, that one cannot rely on pre-installed scripts and functionality. Often it is not possible to install binary tools like Cygwin, Unix tools or script interpreters like Perl or PHP. This leaves me with M$ tools like Debug, Basic, Visual Basic or Powerscript. Even these tools may not be available on every system.

The scripts in this library are all pure text based source code. You should be able to install them by simply copy the library directory onto your system - and you will be ready to Rock'n'roll!

Try out:
    what.cmd - prints usage from the file given as argument (what itself is default)
    _getopt.cmd - parses command line arguments and creates environment variables
    _action.cmd + _status.cmd - used for printing process status
    FormatStr.cmd - outputs columns of strings right or left aligned

Some scripts mimik *nix functions like tail, which, wget, banner.

The scripts are available at: https://github.com/ClicketyClickDK/Underscore

Please read the README file - and if you download the library check the documentation\index.html for more details

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 03:35
by ShadowThief
So I notice that you're taking credit for (an outdated version of) REPL.bat...

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 05:20
by Erik Bachmann
Not exactly. I've made a mistake at the top of the header but the header clearly states:
REPL.BAT was written by Dave Benham

You're right about this version being outdated. Sorry - I've updated to JREPL.bat right away.
Thank you for bringing this to my attention. And Dave - I apologize :oops:

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 06:58
by Squashman
Have you tested all of these scripts to see if they work on 32bit and 64bit Windows?

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 07:12
by Erik Bachmann
Yes! Under Windows 7 32+64 bit and Windows 10. I do not have other versions available. Currently I'm not aware of any vital differences in the batch environment, that should affect these scripts. No references to %ProgramFiles%.

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 07:14
by Squashman
You also have files out there that are labeled as a batch files but are really vbscripts. This may confuse someone who is new to batch files when they can't get it work as a .bat.

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 07:19
by Squashman
Erik Bachmann wrote:Yes! Under Windows 7 32+64 bit and Windows 10.

Can a 16bit program run on a 64bit Operating System?

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 07:24
by Erik Bachmann
Well the .BAT files ARE a wrapper to VBscript or Jscript functionality. This is indicated in the documentation:
xxx.BAT
A wrapper to VBscript or Jscript functionality.
. The scripts are wrapped using cmdize.cmd .
What do you mean by
when they can't get it work as a .bat.
.
They are indeed .bat files calling

Code: Select all

"%windir%\System32\cscript.exe"

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 07:26
by Erik Bachmann
Can a 16bit program run on a 64bit Operating System?

Hmmm - 16 bit batch script?!? I'm not reinventing CMD.exe.

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 07:32
by Squashman
Well I copied the unzip.bat code and I can't get it to work as a batch file.

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 07:33
by Squashman
Erik Bachmann wrote:
Can a 16bit program run on a 64bit Operating System?

Hmmm - 16 bit batch script?!? I'm not reinventing CMD.exe.

You have batch files that are executing 16bit code. That will not work on 64bit Windows.

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 07:46
by Erik Bachmann
It's a library with mutual dependencies. unzip.bat requires _debug.cmd and _GetOpt.cmd. If you need the help function as well, What.cmd is needed too.

I've added a note to the README. So please download the entire library.

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 07:50
by ShadowThief
cEcho.bat will not work on 64-bit operating systems because debug.exe cannot run on them.

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 08:01
by Squashman
Erik Bachmann wrote:It's a library with mutual dependencies. unzip.bat requires _debug.cmd and _GetOpt.cmd. If you need the help function as well, What.cmd is needed too.

I've added a note to the README. So please download the entire library.

I must be the only idiot here because I am not understanding how any of this works. How do you execute unzip.bat?

Re: The "_" Windows Batch Library - now on github

Posted: 15 Oct 2015 08:04
by Squashman
Erik Bachmann wrote:It's a library with mutual dependencies. unzip.bat requires _debug.cmd and _GetOpt.cmd..

Then shouldn't unzip.bat say

Code: Select all

::'::@ (#)REQUIRES
::'::@(-)  Dependencies
::'::@ (#) ]_debug.cmd  and _GetOpt.cmd