JSI Tip 9870. Download TSCMD.ZIP from some miscellaneous scripts and freeware.

Jerold Schulman

October 31, 2005

8 Min Read
ITPro Today logo


Download TSCMD.ZIP from some miscellaneous scripts and freeware.

The TSCMDINF.TXT file contains:

Sun 30-October-2005TSCMDINF.TXT About TSCMD in General         (All rights reserved)===================================ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿³ Please do not distribute any part of this package separately. ³³ If you come upon such a distribution or a reproduction on an  ³³ unauthorized WWW page or similar, please alert the author.    ³ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙFor more information please see the Introduction section at thebeginning of 1CMDFAQ.TXT.Timo Salmi (email: [email protected] WWW: http://www.uwasa.fi/~ts/)Professor of Accounting and Business FinanceFaculty of Business StudiesUniversity of VaasaP.O. BOX 700, FIN-65101 Vaasa, FinlandTSCMD32.ZIP     Script file collection, T.SalmiFilename        Comment--------        --------------------------------1CMDFAQ.TXT     NT/w2k/XP script tricks and tipsCHOOSE.EXE      Ask questions in script filesCOLORMAP.CMD    Display ECHOC.EXE color mapDATE2NUM.EXE    Date into a Julian date numberDELE.CMD        Recoverable command-line deleteECHOC.EXE       Echo in colorsEDATE.CMD       Some alternative date formatsFILEAGE.CMD     Find out how old a file isFILEINFO.CMD    CMD shell for FILEINFO.VBSFILEINFO.VBS    FileInfo Visual Basic ScriptFILE_ID.DIZ     Brief characterization of TSCMDFULLNAME.CMD    Display the full name of a fileMAILDATE.CMD    Build a message's "From" headerM_TSCMD.CMD     Makefile that built this packageNAMEDOWN.CMD    Covert a filename to lower caseNAMEUP.CMD      Covert a filename to upper caseNUM2DATE.EXE    A Julian date number into a dateRECENT.CMD      CMD shell for RECENT.VBSRECENT.VBS      Search folders for recent filesTSCMDIDX.TXT    The questions index separatelyTSCMDINF.TXT    Document (a readme) for TSCMDTSCMDNWS.TXT    News about the TSCMD packageTSPROG.TXT      List of programs from Timo SalmiWAKEUP.CMD      A reminder desktop alarm clockWHEREIS.CMD     Find a file anywhere on a driveXPMOVE.CMD      CMD shell for XPMOVE.VBSXPMOVE.VBS      Move newer files between folders----            ------             ------  -----0027The 1CMDFAQ.TXT "NT/2000/XP script tricks and tips" is a text filein a mailbox format. Thus you can also read it indexed with anysuitable mail program. For example, I use PC-Pine for that purposeon my PC.The latest version of TSCMD is best available without the versionnumber as ftp://garbo.uwasa.fi/pc/link/tscmd.zip to avoid potentialbroken links. The files with and without the version number areidentical.CHOOSE.EXE (Ver. 1.1)  Ask questions in script files=====================Usage: CHOOSE [/c[:]keys] [/?|/h] [/n] [/s] [/t[:]c,nn] [/x] [text]    the prompt keys ÄÙ      ³       ³    ³        ³ ³     ³    ³                      Help ÄÙ       ³    ³        ³ ³     ³    ³No default prompt (only user text) ÄÙ    ³        ³ ³     ³    ³                 apply case Sensitivity ÄÙ        ³ ³     ³    ³  default key after timeout (must be among keys) ÄÙ ³     ³    ³                                Timeout in seconds ÄÙ     ³    ³                          Output @set choose_=returnCode ÄÙ    ³                                           user's text prompt ÄÙMS-DOS 6.0 finally included a CHOICE command for making user choicesin batches. CHOOSE simulates CHOICE for the earlier MS-DOS versionsreasonably accurately. The idea is that if you have obtained a batchthat uses CHOICE, but you don't have MS-DOS 6.0, you can stillutilize the batch. The syntax is naturally based on MicroSoft's,except for the addition of the help switch. The actual CHOOSEprogram is a Turbo Pascal 7.01 program based the author's own,earlier ASK program for making choices in batches. (Contrary toCHOICE, CHOOSE handles also the /t:c,0 timeout correctly.)This program has gained a new lease of life in the NT/2000/XP/...series, since the CHOICE command no longer is a part of the commandline commands set. For more see the item #14 in 1CMDFAQ.TXT (Help!My old batch files won't work since there is no choice).COLORMAP.CMD  Display ECHOC.EXE color map============For more information and alternatives see item #51 "How can I echolines in different colors in NT scripts?"DATE2NUM.EXE (Ver 1.0a)  Date into a Julian date number=======================Usage: DATE2NUM DD MM YYYY [/set] [/?]               include @set ÄÙ      ³                              Help ÄÙCalculates the Chronological Julian Date Number for a localGregorian date.If no date is given, uses today's date.For examples see e.g. items #6 (How does one get yesterday's date?),#13 (How do I get the current day of the week?) and #31 (How manydays ago was 31.12.2002? What date was it 100 days ago?)Note: No extensive validity checking of the date entered isperformed by the program. Save for checking for trivial errorsentering a valid date is up to the user.DELE.CMD  Recoverable command-line delete========Usage: DELE [FileNameToBeMovedToTheTargetTrashFolder]If one deletes files using the DEL command-line command, one cannotretrieve them. DELE.CMD is an intermediate step, emulating theRecycle Bin to an extent. Instead of actually deleting the selectedfiles DELE moves them to a trash folder.ECHOC.EXE (Ver 1.0)  Echo in colors===================Usage: ECHOC bgColor fgColor The text             [0..15] [0..15]Example of usage in an NT CMD.EXE script:  @echo off & setlocal enableextensions  echoc 0 15 Hello world (On black bright white)  echo.  echoc 4 14 Hello again (On red bright yellow)  echo.  echoc 0 13 Done! (On black bright magenta)  echo.  endlocal & goto :EOFLimitations: Echoed words will be separated by exactly one space.But you can use just "ECHOC bg fg" or ASCII 255 for multiple spaces.See item #51 (How can I echo lines in different colors in NTscripts?) and try COLORMAP.CMD for more examples.EDATE.CMD  Some alternative date formats=========Outputs e.g.6509032005.09.03Sat Sep 03 09:26:02 2005Sat, 03 Sep 2005 09:26:02 +0200 (EET)Sat, 03 Sep 2005 09:26:02 +0300 (EEST)Sat Sep 03 09:26:02 2005 Week 35 Day 246Saturday 03 September 2005 09:26:02Sat 03-Sep-2005 09:26Sat 03-Sep-2005 09:26:02Sat 3-Sep-2005 09:26:02La 03.09.2005  9:26:02lauantai 03. syyskuuta 2005  9:26:02lauantaina 03. syyskuuta 2005  9:26:02Useful for example for copying the date from the output to theclipboard for subsequent pasting.FILEAGE.CMD  Find out how old a file is===========Usage: FILEAGE [FileName]FILEINFO.CMD  CMD shell for FILEINFO.VBS============Usage: FILEINFO.CMD FileNameNo wildcardsLong file names should be enclosed in parenthesesFILEINFO.VBS  FileInfo Visual Basic Script============Gives information about a file. E.g.  F:INFTSCMD.DIZ  Size:          152  Attributes:  Created:       14.11.2003 04:27:11  Last modified: 16.11.2003 09:28:59  Last accessed: 26.02.2004 07:16:06FULLNAME.CMD  Display the full name of a file============An important warning: Do not associate with "File Folder", "Folder"or "Drive" types!The intended main usage of this script is the following. In My Computer  Tools   File Types (choose one from the list)    Advanced     Newone can associate file types with additional programs and scripts.Associate the current script and it will open a temporary dosbox todisplay the path to the target file from your desktop.Some customization of the pause logic at the end of the script maybe required.MAILDATE.CMD  Build a message's topmost "From" header============This script forms the beginning "From" line of an email messageheader. It is based on the "From: " and the "Date: " header fields.The information can be needed since sometimes the beginning "From"header is broken or missing altogether. The script is not perfect,but it should be able to handle the most common situations. TheSED.EXE third party program is needed to use this script.The script can distinguish between the two major "From: " formats Timo Salmi  [email protected] (Timo Salmi)M_TSCMD.CMD  A makefile to build this package===========Included for a code demonstration, only. Only needed by the author.NAMEDOWN.CMD  Covert a filename to lower case============Usage: NAMEDOWN [FileName.Ext]No wildcardsFor wildcards use e.g.for %f in (*.JPG) do call namedown %fLong file names should be enclosed in parenthesesNAMEUP.CMD  Covert a filename to upper case==========Opposite of the NAMEDOWN.CMDUsage: NAMEUP [FileName.Ext]No wildcardsFor wildcards use e.g.for %f in (*.txt) do call nameup %fNUM2DATE.EXE (Ver 1.0a)  A Julian date number into a date=======================The "inverse" of DATE2NUM.EXEUsage: NUM2DATE JulianDateNumber [/set] [/?]                      include @set ÄÙ     ³                                    Help ÄÙReturns the local Gregorian date for a Chronological Julian DateNumber."Chronological Julian Date Number is a daycount starting at JulianCalendar BC 4713-01-01 00:00:00 local time = CJD 0.0." (From JohnStockton)With /set returns:  @set dd_=day  @set ddpad_=day zero-padded  @set mm_=month  @set mmpad_=month zero-padded  @set yyyy_=year with four digitselse returns (zero-padded)  YYYYMMDDWith no parameters, returns this help. With only /set givenreturns the current date variables.RECENT.CMD  CMD shell for RECENT.VBS==========Before using you will wish to customize the folder paths (after thelabel "Call the actual VBS script" in the RECENT.CMD to correspondto yours.Be patient. The method is not fast.Usage:  RECENT [DaysBack] [FromTime] [Exact]  Examples:    Find file made today      RECENT    Find files made after 15:00:00 yesterday and after 15:00:00 today      RECENT 1 150000    Find files made two days ago after 07:50:00, but not yesterday    or today      RECENT 2 075000 ExactAlso see below.RECENT.VBS  Search folders for recent files==========Examples of usage:  cscript //nologo recent.vbs C:_F 0 150000will find files made or modified today after 15:00:00 in the C:_Ffolder and all its subfolders.  cscript //nologo recent.vbs "C:Program Files" 1 000000will find files made yesterday AND today. Note the need of thequotation marks, since there is a space in the start folder name.  cscript //nologo recent.vbs C:_F 1 000000 Exactwill find files made yesterday only (since midnight)Hint  cscript //nologo recent.vbs C:_F 1 150000will find files made yesterday AND today after 15:00:00. That goesfor both(!) the days. If you wish to find files made after yesterday15:00:00 inclusive this morning then divide the search into two parts:  cscript //nologo recent.vbs C:_F 1 150000 Exact  cscript //nologo recent.vbs C:_F 0 000000WAKEUP.CMD  A trivial reminder desktop alarm clock==========Usage: c:_FXTOOLSWAKEUP.CMD [HH:MM] ["Message in quotes"]Only cursory syntax error checkingc:_FXTOOLSWAKEUP.CMD utilizes the AT command schedulingFor information on AT apply AT /?WHEREIS.CMD  Find a file anywhere on a drive===========Usage: WHEREIS [FileMask] [/a] [/m] [/s] /a show All files, including hidden /m pipe to More /s Sort by dateE.g. WHEREIS *.XLS /s /mAlternative usage: WHEREIS /?for this brief help.XPMOVE.CMD  CMD shell for XPMOVE.VBS==========Warning: Moving files can always involve some dangers.         All the risks are carried by the user alone.Moves files from FromFolder to ToFolder if an older file with thesame name is found in the ToFolderBefore usage, customize the paths in the cscript call as befits you.XPMOVE.VBS  Move newer files between folders==========Warning: Moving files can always involve some dangers.         All the risks are carried by the user alone.Usage: cscript //nologo xpmove.vbs FromFolder ToFolder [/sub:no]If /sub:no is not present, also ToFolder subfolders are traversedAlternatively use the XPMOVE.CMD shellSkips system and hidden files! Irrespective of whether the attributeis at source or destination.Skips (access denied) if the target file is readonly. However, ifthe source file is readonly, and the target file is not, the filewill be moved. The moved file retains its readonly attribute.



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like