News on the TSCMD scripts package by Timo Salmi in reverse order
================================================================

University of Vaasa, Finland, Linux Pentium garbo.uwasa.fi has a
large collection of Shareware, Freeware and Public Domain PC
programs available by anonymous FTP, WWW (World Wide Web) and mail
server. The file ftp://garbo.uwasa.fi/pc/ts/0news-ts contains news
about the TS-programs in the /pc/ts directory (in reverse order).
This text, which you now have, is an extract from the 0news-ts file
and the Usenet news.

....................................................................
Prof. Timo Salmi   Co-moderator of news:comp.archives.msdos.announce
Moderating at ftp:// & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance  ; University of Vaasa
mailto:ts@uwasa.fi <http://www.uwasa.fi/~ts/>  ; FI-65101,   Finland
Dense spam-kill procmail filtering with a public email key in effect
....................................................................

Thu 6-Mar-2008:  A minor update
 209940 Mar 6 2008 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd46a.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added more information to "10) How can I change the environment
variable values within a FOR loop?"
 Renamed the earlier item "40) How do I get the number of arguments
given to a script?" to a more generic "How to get the number of and
parse the arguments given to a script?" with added tricks.
 Added a new example to the item "80) How can I extract the last part
of a path such as C:\ABC\DEF\GHI\?"

Sat 23-Feb-2008: Released the update
 207709 Feb 23 2008 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd46.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added to the collection the new scripts
  "QP2DOS.CMD   Convert quoted printable encoded file to DOS"
  "MAKEPASS.CMD Make a randomized password"
 Updated
  "EDATE.CMD to display some alternative date formats"
to display some more date formats by adding switches
 /C1 = DD.MMM.YYYY HH:mm:ss
 /C2 = Wkd DD-MMM-YYYY HH:mm
 /C3 = YYMMDD
 /C4 = YYYYMMDD
It also sends the new result to the clipboard if a clipboard utility
is available. For that, get CLIP.EXE from the publicly available
Windows 98 Resource Kit or copy a more recent version from Windows
Server 2003's C:\%windir%\system32 folder.
  Linkrot is inevitable. Updated a number of reference links in the
1CMDFAQ.TXT FAQ file.

Sun 23-Dec-2007: After the many rounds of the FAQ collection the
updates naturally come farther apart. The previous update was in
May 2007. The new update now is
 202569 Dec 23 2007 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd45.zip Useful NT/2000/XP script tricks and tips, T.Salmi
It includes the following new items in the main FAQ file 1CMDFAQ.TXT
 161} How do I test that the Windows Script Host is available?
 162} Finding duplicate files in a directory tree
plus some additions and corrections here and there.
   I have also updated many of the script files included in the
collection. Mainly, I have added a lockfile test to prevent running
duplicate copies of some of the slower scripts which use auxiliary,
temporary files for their tasks. I have also added some tests to
ensure that the path to the %TEMP% folder is present. And some
other, minor changes. Unless there are problems, these exotic
adjustments should be invisible to the user in running the scripts.
Furthermore, rewrote e.g. the following batch to give much more
information
 "FULLNAME.CMD Display the full name of a file"

Thu 17-May-2007: I have made an update
 195399 May 17 2007 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd44.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added the following new items to the included FAQ file 1CMDFAQ.TXT
 159} How do I test that a name does not contain lowercase letters?
 160} How do I get a list of all my folders with and sorted by size?
Added a method for using ANSI escape color sequences to
 51} How can I echo lines in different colors in NT scripts?

Fri 16-Feb-2007: After releasing the version tscmd43.zip it came up
in alt.msdos.batch.nt that some users may use or have to use long
file names for their TEMP and TMP variables. This was news to me.
Although this might just be a rare exception I have browsed through
the FAQ for such eventualities and tried to make the FAQ items and
the included scripts more universal in that respect. Hence a quick
followup release
 193214 Feb 16 2007 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd43a.zip Useful NT/2000/XP script tricks and tips, T.Salmi

Wed 14-Feb-2007: I have made an update
 192436 Feb 15 2007 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd43.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added the scripts
 DATET.CMD   Put the current date parts into the environment
             (Aka the mother of all command-line script FAQs)
 FINDTMP.CMD Find and list all the *.TMP files
             (Mainly a demo of another top FAQ)
 RULER.BAT   An aid to pinpoint CLI screen columns and rows
 TSCD.CMD    Show current/given folder both in short and long formats
 WHOISME.CMD Get IP and user information
Added the following FAQ item to 1CMDFAQ.TXT
 158} Why won't the statements within my if condition work properly?

Sat 13-Jan-2007: Update
 182662 Jan 13 2007 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd42.zip Useful NT/2000/XP script tricks and tips, T.Salmi
The changes include:
 MAILDATE.CMD Build a message's "From" header
  Added an /SUBJ switch to include the subject from the email header
  with the date added.
 NAMEDOWN.CMD Covert a filename to lower case
 NAMEUP.CMD   Covert a filename to upper case
  Corrected the bug that caused a failure for filenames with
  parentheses.
Added to the FAQ file 1CMDFAQ.TXT
 154} How do I remove leading zeros from a string with script only?
 155} How can I use command-line to open a Windows Explorer Window?
 156} How does one create a shortcut using the command-line?
 157} How to get the count of words and the last word of a variable?

Sat 21-Oct-2006: I have once again updated my command-line script
FAQ collection:
 179284 Oct 21 2006 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd41.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added the alternative input option dd.mm.yyyy besides dd mm yyyy for
 "DATEINFO.CMD Display date related information"
Also added a weak date locale test to DATEINFO.CMD.
Added the following new items to the FAQ file 1CMDFAQ.TXT
 150} How can I extract the http and ftp URL:s from an HTML file?
 151} Extract the lines of a text file from between to marker-lines?
 152} How can I remove all !:s and &:s from a text file with a script?
 153} How do I test if my Internet connection to an IP is working?
Added yet another option script-only to
   1} How to get today's date elements into environment variables?

Mon 11-Sep-2006: A date-oriented update of my command-line script
FAQ collection:
 176733 Sep 11 2006 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd40.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added a new, pure-batch script
 "DATEINFO.CMD Display date related information"
An example of the essence of the output
  C:\>dateinfo 10 9 2006
  Date : 10.9.2006
  Julian day number : 2453989
  Weekday           : Sun
  Day ordinal number: 253
  Week number       : 36
  Is valid date     : True
  Days in month     : 30
Added the following items to the FAQ file 1CMDFAQ.TXT
 147} What was the time 100 minutes ago?
 148} How to calculate the day-of-year number with a pure cmd script?
 149} How to calculate a date's week number with a pure cmd script?
Added script commands only solutions to the items
  31} How many days ago was 31.12.2002? What date it was 100 days ago?
  70} Calendar elements: What weekday was December 31, 2004?

Thu 17-Aug-2006: Made an update of my command-line script FAQ
collection
 170796 Aug 17 2006 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd39.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added the following items to the FAQ file 1CMDFAQ.TXT
 145} How to find out if WinXP SP2 is installed via a script?
 146} Using delayed expansion for giving variable values as arguments
Added some further alternatives to some of the old FAQ items.
Included a new demonstration script into the package
 CMD1DEMO.CMD    A CMD syntax selection demo

Sun 18-Jun-2006: Made an update
 167495 Jun 18 2006 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd38.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added the following items
 141} Why isn't the ! character always echoed as expected?
 142} How to extract the filename from the end of an URL reference?
 143} How do I get the current time zone in a script?
 144} How do I parse the items from a path like C:\a\b\c\d ?
As usual, an addition here and there in the already existing items.
Also updated
 "EDATE.CMD to display some alternative date formats"
with more output and a /? switch for help.
Etc.

Mon 1-May-2006: Time for the next update:
 163586 May 1 2006 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd37.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added the following new FAQ items
 136} How do I find out when my PC was last booted?
 137} I need to resize a group of images from the command line?
 138} How can I get the long name of a short-named file or folder?
 139} How do I convert UNIX newlines to PC eolns? And vice versa?
 140} How do I count how many times a word appears in my text file?
Augmented further solution options and information e.g. to
  9} How can I suppress script error messages altogether?
 40} How do I get the number of arguments given to a script?
 64} How to count the number of lines in a file, empty lines inclusive?
 75} How do I detect if an object is a file or a folder?
Corrected the bug in
 "ECHOC.EXE Echo in colors"
which prevented the output of a slash (/)

Thu 9-Mar-2006: Update
 157253 Mar 9 2006 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd36.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added the following new FAQ items
 132} How to find out the next weekday given today's?
 133} How do I get the current IP address, number and name?
 134} How do I advance the dates of my certain JPG files by one year?
 135} How do I get information about a file extension association?
Added an alternative solution to
 85} How to test if a folder contains any files with long names?
Furthermore, the item now also demonstrates how to get the short
version of a file name.
Added a new script
 WEXE2ZIP.CMD Convert a self-extracting exe to zip
Updated the script
 MAILDATE.CMD Build a message's "From" header.
Added counters to the script
 COMPFOLD.CMD Compare the contents of two folders

Sat 11-Feb-2006: Released an update
 153350 Feb 11 2006 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd35.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added three new FAQ items
 129} Is it possible to stop and reset the print spooler with a script?
 130} How do I find and delete files which contain a specific text?
 131} How to get the language of Windows XP in a script ?
Added further alternative solutions to a couple of the old items.

Wed 11-Jan-2006: Made available the update
 150924 Jan 11 2006 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd34.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added the following new FAQ items
 126} How do I grep for a line with a tab?
 127} How can I pad leading zeros or like to a variable?
 128} How to prevent SET /P input from entering the command history?
Added into the package the scripts
 COMPFOLD.CMD Compare the contents of two folders
 SAMENAME.CMD Find same name files in folders (incl. subfolders)
Added output demonstration examples to
 TSCMDINF.TXT Document (a readme) for TSCMD
for the detached script files included in the collection.

Wed 7-Dec-2005: Released update
 144994 Dec 7 2005 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd33.zip Useful NT/2000/XP script tricks and tips, T.Salmi
adding
 124} How do I find files which do NOT contain the search string?
 125} How do I get the age of a file? Or of the files in a folder?

Sun 30-Oct-2005: I have released an update
 143047 Oct 30 2005 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd32.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added the new scripts
 MAILDATE.CMD Build a message's "From" header
 WAKEUP.CMD   A reminder desktop alarm clock
Added to FAQ file 1CMDFAQ.TXT "NT/w2k/XP script tricks and tips":
 119} How can I remove any leading zeros from an unsigned integer?
 120} How do I use AND/OR/XOR/NOT operators in an IF statement?
 121} How do I make a simple reminder to pop up on the desktop?
 122} How to list files present in folder A but not in folder B?
 123} How to test if a file is in a folder or below two or more times?
Rewrote the badly broken script-only solution in
 19} How can one build a delay / sleep / wait procedure for a script?
As usual also made some minor additions and corrections to a few
of the other items.

Sun 25-Sep-2005: Again after the emergence of a few new items and
some minor additions to the old ones I have made an update
 136348 Sep 25 2005 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd31.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added
 114} How do I pick a file's lines that are three characters long?
 115} How can I decompose the path to be one folder per line?
 116} How do I get a list all the *.BAT files which are at path?
 117} Is it possible to get the physical memory from the cmd?
 118} How to handle irregular empty fields of a CSV file?

Sat 3-Sep-2005: A number of new items have arisen to warrant an
update
 133666 Sep 3 2005 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd30.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added
 108} How can I execute a script one line at a time to debug it?
 109} How do I open e.g. three separate instances of notepad at one go?
 110} Can I use a script to determine if a specific printer exists?
 111} How can I detect if a folder is shared or not?
 112} Help, an old program fails to run since I have no floppy drive.
 113} How do I find all *.TXT files on the C: drive sorted by size?
Added FULLNAME.CMD "Display the full name of a file" mainly as a
desktop aid to associate with file types.
As usual also made some minor additions to the already existing items.

Tue 12-Jul-2005: Update
 130301 Jul 12 2005 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd29.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added two new items
 106} How to test whether a variable is a non-negative integer?
 107} How to do non-trivial renaming such as IMG*.jpg to IMG_*.jpg?
Added new, slightly simpler options e.g. to
 26} How do I get the length of a string into a variable?
 27} How can I remove all the blank lines from a text file?
 50} How do I get the position of a substring in a string?
Added testing the LFN-status of a single file besides of an entire
folder to the item
 85} How to test if a folder contains any files with long names?
Totally rewrote the item
 46} Is a program available in the default folder or at path?

Wed 1-Jun-2005: Update
 127577 Jun 1 2005 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd28.zip Useful NT/2000/XP script tricks and tips, T.Salmi
includes the following additions
 99} How do I "touch" a file to update its last modified datestamp?
 100} How can I identify and copy the five latest files from a folder?
 101} How to capture Volume Serial Number into an environment variable?
 102} How can I extract the individual bits from a decimal byte?
 103} How do I exit a loop by pressing a key?
 104} How can one remove double quotes from a script variable?
 105} How to detect whether or not a folder contains hidden files?

Thu 5-May-2005: I have made an update
 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd27.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added the following new items and made some editing of the old
ones. Also inserted some additional comments into the scripts
included in the collection.
 91} How do I get command-line reference help?
 92} How do I play a sound or a tune from the command line?
 93} How do I check if my script was given a parameter?
 94} Can I send the script's output both to the screen and a log file?
 95} How to perform an operation on all the filenames listed in a file?
 96} Can one use a script to columnize a comma separated values file?
 97} I need to remove duplicate entries from the output or a file.
 98} How do I equate all zip files with the date of their latest file?

Tue 19-Apr-2005: I have made an update
 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd26.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added just one new item
 90} How do I get the most recent file within a directory structure?
And made a number of small revisions in the already present items.

Mon 21-Mar-2005: Updated my XP scripts collection adding the
following new items
 84} How can I automate downloading files from an ftp-site?
 85} How to test if a folder contains any files with long names?
 86} How to put each line of a text file into an environment variable?
 87} How can I create a four-digit random string?
 88} How to convert DEC to HEX with a script file, and vice versa?
 89} All of a sudden "echo." doesn't work any more. What's wrong?
The collection is available as
 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 Useful NT/2000/XP script tricks and tips, T.Salmi
Or, with the version number tscmd25.zip

Sat 22-Jan-2005: Updated my
 111572 Jan 22 21:36 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi
adding
 79} How can I trim leading and trailing spaces?
 80} How can I extract the last part of a path such as C:\ABC\DEF\GHI\?
 81} Is there a script to capitalize all the words in a text file?
 82} Why does echo 9>temp.txt fail while echo 10>temp.txt works?
 83} How to archive files with a rotation of five latest generations?
Again made some textual and other corrections kindly suggested by
Dr. John Stockton. Thank you John.
With the version number the collection now is tscmd24.zip

Fri 3-Dec-2004: Compiled an updated version of
 107700 Dec 3 2004 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi
With the version number the file now is tscmd23.zip
Added:
 75} How do I detect if an object is a file or a folder?
 76} How do I create an empty file? How can I detect the empty files?
 77} How do I list the files in \All Users\Desktop in the short format?
 78} Is it possible automatically to record my logon times into a file?
Added a few Visual Basic aided command line script alternative
solutions to the old items.
Added more information and solutions to a couple of items.
Made some textual and other corrections kindly suggested by Dr. John
Stockton.

Wed 8-Sep-2004: Update
 103196 Sep 8 2004 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked
With the version number the file now is tscmd22.zip
Changes:
Added DELE.CMD Recoverable command-line delete
Added the new items
 73} How can I convert a hexadecimal string into an ASCII string?
 74} How can I compare two numbers that have decimals with IF?
Corrected a bug in the accompanying "RECENT.VBS Search folders for
recent files" which prevented recursing into the subfolders of
subfolders.

Tue 10-Aug-2004: Released an update
 99965 2004-08-10 07:49 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked
Added two new switches to
 WHEREIS.CMD "Find a file anywhere on a drive"
 /a show All files, including hidden
 /m pipe to More
Added the new items
 69} How do I get the first, or the last, 400 lines of a file?
 70} Calendar elements: What weekday is December 31, 2004?
 71} How can I reboot my computer from a command line script?
 72} Is it possible to use quotes as delims in for loops?
Made a number of solution additions and corrections to the already
existing items.
With the version number the file now is tscmd21.zip

Mon 28-Jun-2004: Updated
 97091 2004-06-28 21:10 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked
adding the items
 66} How can I delete all the hidden Thumbs.db files from my system?
 67} Is it possible to send a variable value to the clipboard?
 68} How can I test if a program already has been loaded?
The actual version is tscmd20.zip

Wed 31-Mar-2004: Updated
 94268 Mar 31 2004 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi
by adding
 61} How can one devise a command line calculator?
 62} How can I compare within a script if two files are identical?
 63} How to perform a command on each line of file as an argument?
 64} How to count the number of lines in a file, empty lines inclusive?
 65} How do I add text in front and after each line in a text file?
The version number now is 1.9.

Thu 18-Mar-2004: Made the next update of my FAQ-like collection of
NT/2000/XP script tricks and tips. It now is in version 1.8.
Available without the version number as
 91623 Mar 18 2004 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added items:
 57} How do I get a list of all my empty folders on c:\ ?
 58} How do I best combine two quoted arguments into one quoted string?
 59} How do I find if a folder exists? How about visible files in it?
 60} How do I delete all but most recent 20 files in a folder?
Made some solution additions to the already existing items.

Thu 4-Mar-2004: Had to make an immediate update tscmd17a.zip of my
Useful NT/2000/XP script tricks and tips:
Removed the item
 57} How do I get a list of all my empty folders on c:\ ?
since my the solution was far too instable because of problems
caused by potential hidden files and hidden subfolders.

Wed 3-Mar-2004: Updated tscmd.zip Useful NT/2000/XP script tricks
and tips. It is now in version
 88470 Mar 3 2004 ftp://garbo.uwasa.fi/pc/ts/tscmd17.zip
 tscmd17.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added a further, simple XP specific alternative to
 4} How can I test is it on MSDOS/Win3..9x/Me or NT/2000/XP?
Added an only-one-file-needed script solution version to
 8} How do I find all the files made at of after YYYYMMDD HHMM?
Added BASIC solution alternatives to at least the following items
 28} How to convert a file written in IBM PC characters into LATIN1?
 50} How do I get the position of a substring in a string?
 51} How can I echo lines in different colors in NT scripts?
Added new FAQ items
 53} How can I quietly test if a disk device is ready or not?
 54} How can I get the type of a disk device?
 55} How to get the creation, last modified and last access of a file?
 56} How to find and move more recent files from one folder to another?
 57} How do I get a list of all my empty folders on c:\ ?
Added the scripts (needed them myself)
 FILEINFO.CMD "CMD shell for FILEINFO.VBS"
 FILEINFO.VBS "FileInfo Visual Basic Script"
 NAMEDOWN.CMD "Covert a filename to lower case"
 NAMEUP.CMD   "Covert a filename to upper case"
 RECENT.CMD   "CMD shell for RECENT.VBS"
 RECENT.VBS   "Search folders for recent files"
 XPMOVE.CMD   "CMD shell for XPMOVE.VBS"
 XPMOVE.VBS   "Move newer files between folders"
Corrected a bug in WHEREIS.CMD "Find a file anywhere on a drive"
which did not allow spaces in file names.

Mon 2-Feb-2004: Put in circulation the next version of my
NT/2000/XP/2003.. command line scripts FAQ. It is now in version 1.6
and available without the version number as
 73123 Feb 2 2004 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked
Added the program "ECHOC.EXE Echo in colors".
Added the script "COLORMAP.CMD Display ECHOC.EXE color map".
Added:
 51} How can I echo lines in different colors in NT scripts?
 52} How can I enter a password into a variable without echoing it?
Added some information to TSCMDINF.TXT about the programs included
in the tscmd.zip package.
Added Visual Basic Script solutions to the items
  6} How does one get yesterday's date?
 13} How do I get the current day of the week?
 39} Is there a subroutine to convert a variable into uppercase?

Tue 6-Jan-2004: During the holidays I have had time to look further
into my NT/2000/XP command line scripts FAQ. Thus release the next
update with a number of additions. The update is available, as
usual, as
  63443 Jan 6 2004 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
  tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked
or with the version number as tscmd15.zip. But preferably get or
link to the file without the version number.
Added
 FILEAGE.CMD "Find out how old a file is" which at the same time answers
two new items:
 45} How can I find out how many days old a file is?
 46} Is a program available in the default folder or at path?
Added the script
 EDATE.CMD To display some alternative date formats for cutting and
pasting. Happened to need it myself.
Added more new items
 47} Is it possible to echo the redirection symbol in a script?
 48} Why do some comment lines cause errors? What can I do about it?
 49} I need to reverse a text file. How do I do that fairly quickly?
 50} How do I get the position of a substring in a string?
Partly based on a helpful discussion in news:alt.msdos.batch.nt
extended and renamed the item slightly:
 23} How do I get the n:th, the first and the last line of a text file?
Made some other, smaller adjustments. Added a number of further
Google references to related postings.

Sat 27-Dec-2003: The new NT/2000/XP FAQ items still come relevant at
a fair pace. Hence made the next update available, as usual as
  56675 Dec 27 2003 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
  tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked
With the version number the file is
  ftp://garbo.uwasa.fi/pc/ts/tscmd14.zip
This time added the following items
 39} Is there a subroutine to convert a variable into uppercase?
 40} How do I get the number of arguments given to a script?
 41} How can I create a zero-byte file? How do I test for it?
 42} What is the subroutine for testing a filename for wildcards?
 43} Is there a way of counting the number of files in a folder?
 44} How do I get the first 68 columns from a text file?

Fri 19-Dec-2003: Made the next update of my FAQ-like collection of
NT/2000/XP script tricks and tips. It now is in version 13.
Available without the version number as
  53884 Dec 19 2003 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
  tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked
Added the following new items
 34} How can I remove the quote characters from a line?
 35} How can I substitute the second field on each line of my file?
 36} I start a program from my script and it hogs my command window.
 37} How can I insert a line in the middle of a file with a script?
 38} How can I set and test the errorlevel within a script file?
Essentially rewrote
 10} How can I change the environment variable values within a FOR loop?
to explain delayed variable extension.
Corrected some minor typos (and probably made new ones).

Thu 11-Dec-2003: I have updated
  50399 Dec 11 2003 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
  tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked
Also available with a version number as
  ftp://garbo.uwasa.fi/pc/ts/tscmd12.zip
   Added two auxiliary Turbo Pascal program executables to help in
complicated date calculations. The code is based on what I have in
my separate Turbo Pascal FAQ tsfaqp.zip, item #119. It is true that
these conversions can, and have been programmed in straight script
by others. I did not wish duplicate that work. Even more
importantly, a compiled program is fast if there is, say hundreds of
file datetime stamps to browse in some task.
 DATE2NUM.EXE Date into a Julian date number
 NUM2DATE.EXE A Julian date number into a date
Added the items
 31} How many days ago was 31.12.2003? What date it was a 100 days ago?
 32} How can I convert a decimal number to binary, octal, hexadecimal?
 33} How can I convert a binary, octal, hexadecimal into a decimal?
The item
  "14} Help! My old batch files won't work since there is no choice"
now presents the CHOOSE.EXE alternative. The advantage of CHOOSE.EXE
over SET /P is that the former can handle timed default input. The
CHOOSE.EXE program was included in the package.

Sat 6-Dec-2003: At the early stages of a FAQ material accumulates
fairly rapidly. I have made an update
  ftp://garbo.uwasa.fi/pc/link/tscmd.zip
  Useful NT/2000/XP script tricks and tips, T.Salmi, linked
Also available with a version number as
 27680 Dec 6 2003 ftp://garbo.uwasa.fi/pc/ts/tscmd11.zip
 tscmd11.zip Useful NT/2000/XP script tricks and tips, T.Salmi
Added the following new items:
 21} Do you have pointers to additional script material and tips?
 22} How do I capture the current folder name into a variable?
 23} How do I get the n:th and the last line of a text file?
 24} How do I get the m:th item on the n:th line of a text file?
 25} How can I quote with e.g. "> " an entire message?
 26} How do I get the length of a string into a variable?
 27} How can I remove all the blank lines from a text file?
 28} How to convert a file written in IBM PC characters into LATIN1?
 29} How do I drop the first two characters of a string, and so on?
 30} Can one calculate the difference between two times in a script?
   Renamed the first item to be "General information of this script
tricks file package" and right-justified the item's text.
   Changed the name of the companion WHERE.CMD "Find a file anywhere
on a drive" to WHEREIS.CMD. Added the option to sort the results by
the file datetime stamp. Therefore also changed the output order of
the files found datetime stamp to YYYY.MM.DD HH:MM. Added the file
attribute field. Added documentation comments to the source.
   Added TSCMDIDX.TXT "The questions index separately".
   Added M_TSCMD.CMD "A makefile to build this package" to
demonstrate among other things making a ZIP file with file comments
included.

Fri 28-Nov-2003: For some time now I have considered to familiarize
myself better with the NT/2000/XP scripting by starting a new FAQ
collection. So here we go:
  ftp://garbo.uwasa.fi/pc/link/tscmd.zip
or, alternatively, with a version number as
  20353 Nov 28 2003 ftp://garbo.uwasa.fi/pc/ts/tscmd10.zip
  tscmd10.zip Useful NT/2000/XP script tricks and tips, T.Salmi
However, it is recommended that you link to the file without the
version number.
  The main contents 1CMDFAQ.TXT is a text file in a mailbox format.
Thus you can also read it indexed with any suitable mail program.
  This is the first version of TSCMD. One purpose of the early
release is to set up the framework for this FAQ. The following items
were included to start with:
 1}  How get today's date elements into environment variables?
 2}  On Windows XP how do you stop the script files from closing?
 3}  How can I customize the Command Prompt Window with script commands?
 4}  How can I test is it on MSDOS/Win3..9x/Me or NT/2000/XP?
 5}  How do I get a fully qualified path name of my script?
 6}  How does one get yesterday's date?
 7}  How can I test if two files agree in size and datetime stamp?
 8}  How do I find all the files made at of after YYYYMMDD HHMM?
 9}  How can I suppress script error messages altogether?
 10} How can I change the environment variable values within a FOR loop?
 11} How do I retain my original code page in these scripts?
 12} How can I rename all my .JPG files sequentially in a folder?
 13} How do I get the current day of the week?
 14} Help! My old batch files won't work since there is no choice.
 15} Is it possible to echo without linefeed like the Unix echo -n?
 16} How can I get the time without having to press enter?
 17} How can I avoid the potential "ECHO is off." in echoing %myvar%
 18} How does one build re-usable script function modules?
 19} How can one build a delay / sleep / wait procedure for a script?
 20} Is is possible to right-justify numbers or words in a script?
