Batch files - Examples (P*)

Download the ZIPped sources Click the floppy disk icons to download the ZIPped sources

 

Batch file examples
Download the ZIPped sources Name Description OS (1) Last modified
(DD/MM/YYYY)
Remarks
Download the ZIPped sources PadDemo.bat Demo batch file for LeftPad and RightPad subroutines, both written to format strings to be displayed in colums on screen NT 09/03/2007 Also available in VBScript
Download the ZIPped sources PCName.bat Store computer name in environment variable. 95 06/03/2002 This batch file stores the computer name without leading backslashes, as opposed to the NETSETxx.BAT batch files.
Download the ZIPped sources Pictures.bat
Picture2.bat
Picture3.bat
Display all GIF and JPG files in your web browser All 21/03/1999 Three interdependent batch files for MS-DOS
Pict_NT.bat NT 16/07/2002 The NT version is one single batch file
Download the ZIPped sources PMSoon.bat Schedule at relative times instead of absolute times NT 17/02/2001 A "clone" of the Microsoft Windows NT 4 Server Resource Kit's SOON command using NT's native NET TIME and AT commands only.
Download the ZIPped sources PrintHTM.bat V1 Print HTML files from batch files (with printer dialog) NT 31/03/2002 More details on my Print Files page.
PrintPDF also available as KiXtart, Perl, Rexx and VBScript scripts, PrintAny also available as Print.vbs.
PrintAny.bat Print any known file type from batch files NT 13/10/2006
PrintHTM.bat V2 Print HTML files from batch files (without user interaction, to any printer) NT+Kix 09/02/2002
PrintPDF.bat Print PDF files from batch files NT 19/10/2007
Download the ZIPped sources PrintPPT.bat Open a print dialog for a specified PowerPoint file NT 11/06/2008 Uses PowerPoint or the PowerPoint Viewer, version 2003 or 2007, whatever is available
Download the ZIPped sources PrnPDF8.bat Print a PDF file to any printer XP 14/06/2008 Uses Foxit Reader or Adobe Reader 8, whichever is available
Download the ZIPped sources ProdID.bat Display Windows' Product ID and store it in an environment variable "ProductID" NT 31/03/2002 Also available as KiXtart and VBScript script
Download the ZIPped sources PwdNoExp Set "password never expires" for a local account XP 12/03/2008 Requires WMIC.
Also available in VBScript.
Notes: (1) Operating System version these batch files were meant for
All No version specific commands are used, though it is (obviously) not tested with every DOS version available
95 Windows 95 (and probably Windows 98 as well)
98 Windows 98
DOS3 MS-DOS 3 and 4
DOS6+ MS-DOS 6 and later
Kix Windows (most functions also in plain DOS) with KiXtart
NT4 Windows NT 4 (Windows NT 4 Terminal Server Edition too)
NT Windows NT (Windows 2000 and Windows NT 4 Terminal Server Edition too)
NT+RK Windows NT with Resource Kit (Windows NT 4 Terminal Server Edition with Resource Kit too)
W2K Windows 2000, and probably XP and Server 2003 as well
W2K+RK Windows 2000 with (Server) Resource Kit, and (probably) XP and Server 2003 as well
W2K3 Windows Server 2003
XP Windows XP
OS2 OS/2 Warp
TS Windows NT 4 Terminal Server Edition, or Windows 2000 Server or Windows Server 2003 with Terminal Services