Archive for the ‘Windows XP’ Category

Loop through each line in a text file using a windows batch file

for /F "tokens=*" %%A in (myfile.txt) do (
   echo %%A

Windows cmd with history

PyCmd is a smart command prompt extension for Windows’ cmd.exe. Its purpose is to emulate a few power features of UNIX shells (decent Tab-completion, persistent history, etc.). You only have to download and unzip the package.

How to find open ports

The following command will show you which ports are open on your computer and what program hold the port:

netstat -anbo

With the following command you can search for an open port:

netstat -anbo|find "61616"

Display system information for Microsoft Windows

Displays complete system information for Microsoft Windows XP Professional or Windows 7 computers.

systeminfo[.exe] [/s Computer [/u Domain\User [/p Password]]] [/fo {TABLE|LIST|CSV}] [/nh]


How to get the directory structure of a drive or path

The tree command displays the directory structure of a drive or path graphically.

tree [drive:][path] [/F] [/A]

/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.

tree c: /F

The dir command allows you to see the available files in a directory.

dir [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

dir /s /b

Substitute paths as virtual drives on Windows

With the subst command you can associate a path with a drive letter.

subst [drive1: [drive2:]path]
  • drive1:               Specifies a virtual drive you want to assign a path.
  • [drive2:]path     Specifies a physical drive and path you want to assign to a virtual drive.

Create new virtual drive

subst Z: "C:\Documents and Settings\All Users\Shared Documents"

Display a list of current virtual drives


Delete a substituted (virtual) drive

subst Z: /d

Persistent Substituted Drives

Drive letters mapped in this way are not available during system startup for services nor do they persist across a reboot. To use persistent mapping you have to create a new registry entry or you can use psubst:

Categories: Windows XP

Edit Windows hosts (file)

For Windows NT, 2000 and above


Registry key under \HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts

Categories: Windows 7, Windows XP