<http://www.netikka.net/tsneti/info/tscmd020.htm>
Copyright © 2003-2010 by Prof. Timo Salmi  
Last modified Mon 26-Apr-2010 09:01:10

 
Assorted NT/2000/XP/.. CMD.EXE Script Tricks
From the html version of the tscmd.zip 1cmdfaq.txt file
To the Description and the Index
 

This page is edited from the 1cmdfaq.txt faq-file contained in my tscmd.zip command line interface (CLI) collection. That zipped file has much additional material, including a number of detached .cmd script files. It is recommended that you also get the zipped version as a companion.

Please see "The Description and the Index page" for the conditions of usage and other such information.



20} Is is possible to right-justify numbers or words in a script?

Yes. Basically this is the same question as padding a variable with leading blanks. E.g. you might have within a script
  set fsize_=         %%~zf
  set fsize_=!fsize_:~-10!

The more generic version of padding is given by the subroutine LeadVar in item #127.
  LeadVar MyString PadWith MaxLength return_

Other cases of the padding in this FAQ include the later subroutines in the item #12 "How can I rename all my .JPG files sequentially in a folder?" and the FuncRightJustify routine in WHEREIS.CMD script included in this collection. Furthermore, RightJustify10 in item #8.

For left-justification see item #96.