Rexx, Kix, VBScript and batch scripts

for NT administrators

P..Z

Warning:    Many scripts on this page are very powerful tools.
Like most powerful tools they could cause a lot of damage in the hands of insufficiently skilled users.
Treat these scripts like you would treat a chainsaw: with utmost care. Do not use them if you do not fully understand what they do or how they do it.
Any damage caused using these scripts is completely your own responsibility.

 

0..9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 

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

 

Download the ZIPped sources Name Description OS version Last modified
(dd/mm/yyyy)
Download the ZIPped sources PCName.bat Store computer name in environment variable.
This batch file stores the computer name without leading backslashes, as opposed to the NETSETxx.BAT batch files.
95 06/03/2002
Download the ZIPped sources PMSoon.bat A "clone" of the Microsoft Windows NT 4 Server Resource Kit's SOON command using NT's native NET TIME and AT commands only. NT 17/02/2001
Download the ZIPped sources Printers.kix PRINTERS.KIX is a Kix script that will map ports to network printers, based on the settings it reads from a (personal) INI file; if no mapping is specified for LPT1, LPT1 will be mapped to the default printer. NT 17/10/2000
Download the ZIPped sources RemoteSID.bat Shows who is logged on to a remote computer, displaying both user ID and Security ID (SID).
Uses PSLOGGEDON.EXE from SysInternals' PsTools "suite"
NT+RK 15/11/2001
Download the ZIPped sources RmUserID.bat Delete a user account and the associated data and share.
Uses the following tools: DSGET and DSQUERY (native in Windows Server 2003, will work in Windows 2000 and XP), RMTSHARE and TAKEOWN (Windows NT 4 Server Resource Kit), TSCMD (www.systemtools.com) and OWN.BAT.
Modify the server and share names to match your own environment.
2000+RK 23/10/2004
Download the ZIPped sources RxAssoc.bat Associates the REX extension with Regina Rexx executable. After executing this batch file once, you can call any *.REX directly, without the need to precede it with REXX.EXE.
With SET PATHEXT=.REX;%PATHEXT% (better yet: set it as a global variable in Control Panel, System) you won't need to type the .REX extension to run .REX scripts.
Adapt the (hard coded) path for REXX.EXE to your own situation.
Better still, use REGINA.EXE instead of REXX.EXE.
NT 11/02/2000
Download the ZIPped sources ScrnRes.bat Change remote PC's screen resolution (requires PSEXEC from SysInternals' PSTools and 12noon's Resolution Changer) NT 25/08/2004
Download the ZIPped sources Servers.bat Display size, free space and used space (both in MB and as a percentage of disk size) for every partition on every server.
Also available in Rexx and VBScript as FreeSpace.*
NT+RK 24/05/2001
Download the ZIPped sources SetOwn.bat Restore ownership and permissions for roaming (TS) profile directories.
Requires several (third party) tools, you will be prompted for downloads if these tools are not available.
W2K3 02/07/2005
Download the ZIPped sources ShareMig.bat 1.00
ShareMg2.bat 2.00
ShareMg2.vbs 2.00
Migrate all non-printer shares from one server to another.
Version 1.00 needs to be run on the server, and fails on share names containing spaces, but it is "universal" for both Windows 2000 and Windows Server 2003.
Version 2.00 requires both the batch and the VBScript file, and needs manual modifications for Windows 2000, but it can be run from any computer in the domain and it won't fail on share names containing spaces.
(For printer migration, use Microsoft's PrintMig; for Scheduled Tasks migration, copy the scheduled tasks -- %windir%\Tasks\*.job -- to the new server, and use JT.EXE to re-set the "Run as:" property for each migrated task.)
2000 02/11/2005
Download the ZIPped sources ShortExt.bat Display or modify "extension truncation" registry setting.
(Based on a tip from the Windows Registry Guide)
NT 02/03/2002
Download the ZIPped sources SNDisk.bat Display harddisk characteristics gathered by IBM's E-Gatherer tool.
May work in XP and Server 2003 too, tested only in 2000.
May generate an error message on non-IBM systems, but will still show the desired results.
More info on EGatherer's undocumented switches.
This batch file depends on E-gatherer's backwards compatibility with older versions, which is entirely up to IBM.
2000 05/03/2005
Download the ZIPped sources SrvInv.vbs Show and log a server hardware and software inventory.
Created using Microsoft's Scriptomatic tool.
WMI 14/09/2005
Download the ZIPped sources SrvSpace.bat Display free space for every partition on every server. TAB delimited screen output for easy export of output.
For Windows XP use DiskSpc.bat instead.
NT 05/06/2000
Download the ZIPped sources Startup.vbs Display all startup commands (Startup folder and registry Run) for any WMI enabled computer on the network WMI 16/01/2003
Download the ZIPped sources TaskMgr.bat Disable or reenable task manager NT 15/03/2002
Download the ZIPped sources TempNWD.bat Temporarily map a network drive or use an existing mapping, and remove it afterwards (unless an existing mapping was used). NT 29/04/2001
Download the ZIPped sources UniqueID.bat Remove Intel LANDesk agent's ID and force creation of a new unique ID 95 NT 13/07/2001
Download the ZIPped sources UpTime.bat
UpTime.vbs
Two scripts that display the amount of time a system has been up and running.
More or less equivalent to my OS/2 Rexx script LastBoot.cmd and Windows VBScript script LastBoot.vbs.
NT+RK/WMI 22/04/2006
Download the ZIPped sources VMList.vbs List all Virtual Machines and their associated files on the local Virtual Server Host W2K3 22/04/2006
Download the ZIPped sources WANIP.bat Display your WAN connection's IP address and host name.
Idea: Gregg Dotoli.
Requires WGET.
NT 16/05/2005
Download the ZIPped sources WhoAmI.bat Show info on workstation and current user
Also available for OS/2 as WhoAmI.cmd
NT OS2 12/06/2000
Download the ZIPped sources WhoHasIt.bat Show info on remote workstation and current user.
Uses DSQUERY & DSGET from Windows Server 2003.
2000 21/10/2004
Download the ZIPped sources WhoIsIt.bat Show specified domain user's display name.
Uses DSQUERY & DSGET from Windows Server 2003.
2000 21/10/2004
Download the ZIPped sources WhoRU.bat Remote WhoAmI (Who Are You) NT+RK 15/10/2000

 

0..9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 

Windows version:      95      Windows 95/98
  NT   Windows NT, usually version 4, including Terminal Server, and most likely Windows 2000 and XP as well
  2000   Windows 2000 and probably XP as well
  XP   Windows XP
  W2K3   Windows Server 2003
  TS   Windows NT 4 Terminal Server Edition or Citrix WinFrame
  WMI   Any Windows with WMI
  +RK   Uses either Regina Rexx or some utilities from the Microsoft® Windows NT® 4.0 Resource Kit
(RK) means that the Resource Kit does add some functionality, but is not absolutely necessary.
  DOS   May be adapted to use in DOS as well
  OS2   Multi-platform (NT plus OS/2) or available separately for OS/2

 


Related links: