JFL Tool Box

My favorite home-made command line tools.

2016-04-17 IMPORTANT UPDATE: All these files have been (or will be eventually be) open-sourced on GitHub, in the SysToolsLib repository. The version here may not be up-to-date. To be sure to get the latest version, go to SysToolsLib. The SysToolsLib repository also has convenient interfaces for entering bugs, or improvement requests.

Name Description Example

Windows-specific management tools

Harware and BIOS management

clocks.exe Measure the system clock frequency, and the resolution of various timing functions. clocks
cpuid.exe Identify the processor, and display its various capabilities. cpuid -v
ilo.tcl Manage one or many iLOs in parallel. Also usable in Linux. ilo atlas[1,2] power on
sector.exe Display or copy disk sectors. Decode or modify the MBR partition table. sector 80:
smbios.exe Dump SMBIOS structures smbios -a

Clipboard

12.bat Pipe Windows clipboard contents into a program, then that program output back into the clipboard. 12 sort
1clip.exe Pipe Windows clipboard contents into a program. 1clip | sort
2clip.exe Pipe a program output into Windows clipboard. dir | 2clip

Misc

accw32.exe Type European characters on US keyboards. Also requires accdll32.dll. Better for programmers than Windows' US-international keyboard, as you don't want ' space or ^ e to produce accentuated characters in your programs. Alt+Shift+accent_key then vowel
cascade.tcl Align a set of similar windows regularly. Uses Twapi. cascade notepad
Disable-IPv6Components.ps1 Disables Windows IPv6 component. Useful for diagnosing networking issues.  
Disconnect.bat Disconnect a hung drive. Useful on laptops moved from site to site. Warning: Kills and restarts the Windows Explorer shell. disconnect
driver.exe Manage Windows 9X and 2000+ drivers.  
Enable-IPv6Components.ps1 Enables Windows IPv6 component. Useful for diagnosing networking issues.  
IESec.ps1 Display Internet Explorer security mode settings. iesec -?
IPcfg.bat Front end to ipconfig.exe, filtering its output to make it more readable. Numerous options to select the information needed. ipcfg &:# Display just Ethernet and Wifi interfaces
Is-WindowsActivated.ps1 Test if Windows is activated.  
MsgBox.exe Display a message box, and return the result as an errorlevel to batch files.  
Out-ByHost.ps1 Execute PowerShell commands on remote machines in parallel, displaying results like Unix pdsh: That is as pure text lines, prefixed by the remote machine name. Requires installing Out-ByHost.ps1 and Reconnect.ps1 on every target system. Out-ByHost (atlas 1..4) {update S:\tools C:\tools}
Reconnect.bat Reconnect disconnected network drives in a cmd prompt. Useful on laptops, or with both admin and non-admin shells. reconnect U:
Reconnect.ps1 Reconnect disconnected network drives in a PowerShell prompt. Useful in combination with Out-ByHost.ps1 as remote user shells are disconnected by default. reconnect
regx.bat Manage the registry as if it were a file system. Output formatted as SML. regx dir HKLM\SOFTWARE\Microsoft\Windows
Test-IPv6Components.ps1 Test if Windows IPv6 component are enabled or disabled. Useful for diagnosing networking issues.  
Window.ps1 Move and resize windows. window -?

General purpose command-line tools (WIN32 version here, also available for DOS/WIN64/Linux)

Convert data

All these tools are usable in a command line pipe, and are particularly useful in combination with the 12.bat batch.

72w.bat Convert UTF-7 text to Windows characters.  
82w.bat Convert UTF-8 text to Windows characters. Useful to decode scrambled emails. Uses conv.exe.  
b64dec.tcl Decode base64-encoded data.  
conv.exe Convert from/to various character sets.  
detab.exe Remove tabulations, replacing them with spaces.  
dump.exe Hexadecimal dump.  
lessive.exe Remove blank characters from the end of lines.  
remplace.exe Replace any characters by others, including CR and LF. 1clip remplace "; " \r\n | sort &:# Sort an email distribution list alphabetically
u2w.bat Convert Unix End-Of-Lines (LF) to Windows End-Of-Lines (CR LF).  
w2u.bat Convert Windows End-Of-Lines (CR LF) to Unix End-Of-Lines (LF).  

Manipulate structured trees

sml.tcl Convert XML files to a much simpler structured text format, and back. type config.xml | sml
show.tcl Display files contents, or whole directory trees contents, in a simple structured text format. show /proc/fs
xpath.tcl Use XPATH to extract data from an XML file. xpath --dir config.xml /root/display

Manage directories

backnum.exe Make a backup copy of a file, appending a unique number to its name.  
cfdt.tcl Change files dates and times. Option for using a Jpeg picture internal time. cfdt --i2m *.jpg &:# Change the files time to image time.
dirc.exe Compares directories side by side. dirc oldDir newDir &:# Compare directories based on the files time and size.
dircc.bat Front end to dirc.exe. Compare file trees recursively, listing only different files. dircc oldDir newDir
dirsize.exe Compute the total size used by a directory ot tree. dirsize -s -t &:# Find which subdirectory uses up all that space.
mcd.bat Create a directory, and go there, in a single command. mcd TempDir
redo.exe Execute a command recursively in a whole directory tree. redo dirsize -t &:# Same end result as the above dirsize example.
rhs.bat Set all RHS flags for a file. Conversely, -rhs.bat removes them all. -rhs msdos.sys &:# Often needed in the 1980s.
rxrename.tcl Rename a series of files, based on a regular expression.  
touch.bat A poor man's pure batch version of touch.exe. touch source.c
trouve.bat Find files containing a string. Uses WIN32 ports of Unix find and grep tools. trouve "Error 1234" &:# Did I record this error before?
truename.exe Display the true name of a file or directory, like old DOS' truename internal command. Resolves links, junctions, etc. truename "C:\Documents and Settings"
update.exe Copy files only if newer. update -X *.c X:\backup &:# Display files which need updating, but don't do it.
xfind.bat Front end to the WIN32 port of Unix find. Avoids conflicts with Windows' find.exe. xfind . -type f "Error 1234" &:# It's easier to use trouve.bat though.
zap.bat Delete files and directories, displaying the exact list of files deleted. zap *.obj *.lst
zapbaks.bat Delete all kinds of backup files (*.bak, *~, etc...), optionally recursively.  

Manage paths

addpath.bat Manage the local and global path easily. addpath | sort &:# Display the local path, one entry per line, sorted. Useful to check if a a directory is already in a long %PATH%.
AddPaths.bat Configure the system path to include my tool boxes addpaths
which.exe Check which program will execute by the given name. Supports any executable type, including tcl and ps1. (Contrary to most WIN32 ports of which, which ignore Windows' %PATHEXT% variable, and don't know the different precedence rules of cmd and powershell shells.) which which
x.bat Use WIN32 ports of Unix tools, even if they're behind a Windows' homonym in the PATH. x expand ... &:# Use Unix' version, not Windows'.

Misc

chars.exe Display a table of ASCII and all 8-bit characters.  
FlipMails.tcl Convert mail threads into a single ASCII text file with mails in chronologic order. 12 flipmails
inicomp.exe Compare .ini or .reg file contents. Compares sections and items alphabetically, whatever their order in the input files.  
MakeZip.bat Create a zip file, based on a list of files in an input file. Uses 7-zip. makezip tools.lst &:# Builds tools.zip.
tclsh.bat Find the Tcl shell even if it's not in the PATH. Configure Windows to run *.tcl files as command-line scripts.  
tee.exe Duplicate the input from stdin to multiple parallel outputs. dir | tee -a work.log

Source libraries

Library.bat A wide selection of batch functions, including a powerful structured programming and debugging framework.
Self-test capabilities.
Use meta keywords like: %FUNCTION% %POPARG% %UPVAR% %ECHO% %RETURN%
     

Most programs and scripts support a -? option, for displaying a command line help screen,

Source available upon request for .exe programs.

Contact: jf.larvoire à free.fr

Install ActiveState Tcl to use the Tcl scripts in Windows.
In Unix/Linux, Tcl is usually installed by default.

Vous êtes le èmevisiteur.