Scripting tools for Windows

Many years ago, before the time of Windows, I had a large set of DOS utilities to accomplish various file management tasks. After Windows 95 showed up, use of many of those tools gradually faded as they were one by one replaced various GUI tools. In recent times, however, I have again accumulated a set of DOS-based tools, this time mostly used for scripting. Below are some of my favorite current-day Windows command line tools:

  • JPSoft 4NT – a complete replacement for Windows standard command interpreter, cmd.exe. 4NT introduces countless additional commands and features that make scripting much more pleasant. 4NT is to cmd.com sort of like bash is to sh. JP Software’s other product, more “modern” graphical shell TakeCommand isn’t as attractive because it doesn’t run native DOS applications but opens a separate DOS box for them instead—exactly what one wants to avoid when opening a DOS box for command entry.
  • XXCOPY – a massively enhanced copy command. I use it to copy directory structures (massive directory structures copy much more reliably using xxcopy than DOS copy), and for some more specialized tasks which would be otherwise hard to accomplish, such as creating intersection between the contents of two directories.
  • Tar for Windows and Gzip for Windows – UNIX-like tar and gzip for DOS. Great for creating archives on Windows system, to be exported to a UNIX system for easy processing. GnuWin32-project has also several other UNIX-commands ported for Windows.
  • Renamer – allows mass-rename of files matching a regex pattern, to a new regex pattern
  • For scriptable communications from Windows command line (besides the built in telnet and ftp), PuTTY provides a command line SCP client which you can find from their download page under the name “PSCP”. Also WinSCP can be used from the command line. VanDyke Software’s high quality SecureFX (SFTP) utility also offers a command line application that can be scripted.
  • I should also mention Cygwin which is “a Linux-like environment for Windows”. Personally, I have steered away from it as while it implements many common UNIX/Linux commands on Windows, it makes Windows scripting more difficult — if you dislike Windows so much that you try to make it function like Linux or UNIX, then use Linux or FreeBSD instead :).

Microsoft has also realized that scripting for automation is increasingly important. Microsoft’s extensible PowerShell is available for Windows XP, Windows Server 2003, and Windows Vista, and will be available for the upcoming Windows Server 2008 (Longhorn). For more info on PowerShell see Windows PowerShell @ Wikipedia, Scripting with Windows PowerShell, and Windows PowerShell Blog.  Do note that PowerShell integrates itself rather tightly to the system and this has repercussions: At the time of this blog entry there is no PowerShell version for Windows 2003 SP2, and if you install PowerShell to Win 2003 SP1 and then upgrade the system to SP2, you can’t uninstall PowerShell!  I’m not sure if I want to base my system scripts on technology that is not very transportable and that has dependencies that aren’t kept up to date with the operating system and the service packs. There’s more discussion about this issue on the PowerShell blog.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.