Personal      Links/Resources       
homesite map

Home
Command-Line
Encarta
Exchg and Outlook
PDAs
Windows Tips
NT Tips
Win2000 and XP Tips
Registry
FrontPg Extensions
DataBase
Router Info
IE tips and tools
Linux
Wireless
Home Owner Protection
Keep Spam in check
Windows XP tips
Win Processes

Back to the Norris Home Page

 

 

DOWNLOAD: ARP ASSISTANT
The Windows ARP utility comes in handy when you need to check out the ARP cache to diagnose connectivity problems. This HTA adds a GUI front end to the tool to make the process a bit easier.

Use Nbtstat to gather NetBIOS information -- Great article on Tech Republic

Another NetBIOS name tool
A number of tools on the Internet provide NetBIOS name services, but one of my favorites is NBTScan. Although it's not a Microsoft tool, NBTScan also scans a network for NetBIOS name information and provides some nice features. Plus, the tool is a freeware title available for download.

How can you determine which ports a specific process is using on Windows XP and later?

If you want to find out which ports a process is using and you know the process name, you must first determine the process identifier (PID). For example, to identify the PID for the pop3svc.exe process running on my system, I went to the command prompt and typed

c:\> tasklist /fi "IMAGENAME eq pop3svc.exe"

This command returned the following information:

Image Name PID Session Name Session# Mem Usage

POP3Svc.exe 3044 RDP-Tcp#9 0 2,072 K

The second column shows the PID, which I can then use with the Netstat command to search all in-use ports. For example, if I type

c:\> netstat -ano | findstr 3044

my system returns the following information:

TCP 0.0.0.0:110 0.0.0.0:0 LISTENING 3044

This result shows that the POP3 service was using TCP port 110 on all addresses.

You can also perform a reverse operation to find out which process is associated with a port. For example, to identify which process is using port 25, I could go to the command prompt and type

c:\> netstat -ano | findstr :25

On my system, this command returns the following information:

TCP 0.0.0.0:25 0.0.0.0:0 LISTENING 2500

After I identify the process (in this case, 2500), I can determine the process name by typing

c:\> tasklist /fi "PID eq 2500"

which returns the following information on my system:

Image Name PID Session Name Session# Mem Usage

inetinfo.exe 2500 RDP-Tcp#9 0 5,584 K

This information tells me that port 25 is being used by the inetinfo.exe process.

Note: Above information was obtained from Windows 2000 Magazine mail list.

Scripting Resources from Windows Magazine:

Patrick Goodwin, who reads the HowTo Mailing List(see the URL below), recently offered readers a startup boot script that he uses to help automate service pack installation. (Goodwin's employee, Chi Kin To wrote the script.) The script checks the OS type and service pack level against presets written into the script code. If the system doesn't meet conditions (e.g., Windows 2000 Service Pack 4--SP4--isn't installed), the script places that computer in a service pack installation group (a Group Policy Object--GPO). The original script creates a second script on the system that schedules a system reboot at a predetermined time (e.g., in the middle of the night when no one uses the system). When the system reboots, the system downloads and installs a copy of the service pack. When the same script runs again and determines that the system has the specified service pack installed, the script moves that system out of the service pack installation group.

http://63.88.172.96/listserv/page_listserv.asp?s=howto

Depending on your particular situation, you might find this script handy. You might also consider modifying the code to fit another task or purpose. Also, if you want to learn scripting techniques, the script serves as a good example of how to perform various actions, such as determining an OS type, service pack level, and GPO membership. You can access the script to examine or use in the HowTo for Security mailing list archives (see the first URL below). At the second URL below, you'll find another version of the script (Chi Kin To also wrote this version), which has additional code that checks a machine's IP address to make sure it's connected to the local subnets before any actions are performed. This check might be helpful for systems connected over slow WAN links. The IP address check can ensure that the script doesn't cause that system to try to download a huge service pack file over a slow link.

http://www.secadministrator.com/listserv/page_listserv.asp?a2=ind0308c&l=howto&p=3253

http://www.secadministrator.com/listserv/page_listserv.asp?a2=ind0308d&l=howto&p=2351

You can get a head start on script writing by searching for ready-made scripts on the Internet, by learning about scripting techniques in various forums, and of course by reading the Windows Scripting Solutions newsletter. (You can learn more about our scripting forum and newsletter at the URLs below.)

http://www.winscriptingsolutions.com

http://www.winnetmag.com/forums/categories.cfm?catid=43

 

Script like the pro's: Visit the TechNet Scripting center. They also have a ScriptoMatic tool!

A few NT command line utilities:

ipconfig or ipconfig /all.  The /displaydns switch

returns the list of all cached DNS names, and the /flushdns switch

clears the cache.

 

Need to know your total uptime on that workstation or server? 

One way is to enter the following at the command prompt:

C:\> net statistics workstation | more

 

Net config server  or Net config workstation will return valuable NT information about a machine.

nbtstat

winipcfg (The Ip config GUI utility)

ipconfig (The ip config utility in Win 2000- non GUI)

winmsd for NT Diaganostics

windisk starts the disk administrator tool

ntipcfg

netstat -a or netstat-ar will tell you open ports on that machine

nslookup connects you to a DNS server on the net for lookups of IP's and names.

STARTING AND STOPPING THE PRINT SPOOLER

If you find yourself having to start and stop the print spooler

frequently, you can use the "netsvc" command from the Windows NT 4.0

Resource Kit to manage services on remote computers. You can write a

command such as

netsvc spooler \servername /start

netsvc spooler \servername /stop

Put these two commands in two individual batch files, with

shortcuts on your desktop. Simply double-click one or the other, and

the print spooler starts or stops as desired!

 

Modify the Command Prompt to work the way you want it to. Nice article at TechRepublic.

 

DirectX info

 

Want information on the DirectX that is installed on your computer...  From a run prompt type:  dxdiag

Systernals provides a nice freeware command line tool , called PSloggedon, that provides a comprehensive listing of who's logged on to a Windows NT system at a given time.

 

Foundstone has some nice freeware tools including Fport  which identifies which applications are listening on which ports. (A great way to uncover Trojan horses installed on your system.)

 

 

Browstat is a part of the Windows 2000 support Tools set. To install it run the setup in the \support\tools directory on the Win2K install disk. This tool is excellent for helping to find browsing issues on your network.  You may also want to checkout Windows magazines Instant Doc ID 25643 for more information on browsing network issues.

 

 

ADDING USER ACCOUNTS FROM A WINDOWS NT COMMAND LINE: You can add or delete computer accounts from the command line. Thistype of functionality is essential if you use script or bat files to automate tasks. From the command prompt, use the Net command:

Net computer \\computername /Add /Del.

You must have the appropriate permissions to add or delete an account in order for this to work.

To obtain a list of accounts in the domain that a

computer is a member of, use the NET USER /DOMAIN command-line option.

You can, of course, redirect the output of the NET USER command to a

file for printing or other editing

FILE BY ASSOCIATION

Users sometimes accidentally associate the wrong application with a

file. Two commands, ASSOC and FTYPE, allow you to correct this problem

by managing file associations from a command prompt (or in a batch

file).

Typing assoc, without parameters, displays the currently defined file

extensions. Type assoc .wav to display the .wav file association.

Typing assoc .wav= will delete the .wav association.

Typing ftype without options displays the file types that have defined

open command strings. Enter ftype SoundRec to display the open command

string for the file type SoundRec. Typing ftype SoundRec= will delete

the open command string.

To define a new association for .log files that you want to open with

Notepad, use the following syntax:

assoc .log=LogFile

ftype LogFile=%Systemroot%\System32\notepad.exe %1

You can use a combination of these command-line utilities in a batch

file or to re-associate files across your network if you run it as a

logon script. For more information, type ftype /? at the command

prompt.

Win 9X commands:

winipcfg on a Win 9x machine give you IP address info

sysedit bring up a system editor for INI files

msconfig will give you some configuration options

windiff for comparing files and directories

HWinfo /ui ran from the run command on a  Windows 98 machine gives you a wealth of information on the software and hardware on a WIndows 98 machine.

SEARCHING FOR NETWORK SHARES WITH NET VIEW

You can use the NET VIEW command-line utility to display a list of a

computer's network shares. However, if a server or workstation has

several or perhaps even dozens of shares, the list may scroll off your

screen. Obviously, you can prevent the list from scrolling by piping

the list results through the MORE command, but you would still have to

search through a long list for the share you seek. Instead, try piping

the NET VIEW results through the FIND command, and specify a search

string of characters that appears in the name of the share you're

looking for.

Consider the following command where %computername% is the name of the

target computer and %string% is the search string:

NET VIEW \\%computername% | find "%string%"

With this command, a list of only the target computer's shares that

contain the characters found in the search string will be displayed.

For example,

NET VIEW \\server1 | find "docs"

will find any shares on server1 containing docs. (Keep in mind that the

search string is case sensitive.)

 

TROUBLESHOOTING NETWORK CONNECTIONS WITH W2K's PATHPING UTILITY

If you're experiencing packet loss on your network, Windows 2000's

PATHPING utility can help you pinpoint the problem. Here's a look at

how to generate and read reports and why they're useful.

 

if you type a command on a command line and follow
it with && and another command, the second command executes only if the
first one is successful. If you use a || between two commands on a
command line, the second command executes only if the first one fails.
   "Did you know you could chain the &&
and || pipes on a command line? This allows you to make a 'do this if it
succeeds, do this if it fails' single command line. For example:

dir c:\ && Echo Drive Exists || Echo Drive Doesn't Exist

displays the listing followed by 'Drive Exists' when used with a defined
drive letter, and displays 'Drive Doesn't Exist' when used with an
undefined drive letter."

Making a BootDisk

A 3.5" MS-DOS 6.22 boot disk that lets you boot a computer and access shared files across a TCP/IP network is a useful administrative tool. A TCP/IP boot disk is handy when you're using imaging software to roll out a standard client image across the network, running an unattended installation of Windows NT 4.0, or troubleshooting a machine that has a FAT partition. The main problem with a TCP/IP boot disk is fitting onto one disk all the files that you need to access a share across a TCP/IP-based network.

Few administrators have access to a machine that they can use to directly format an MS-DOS TCP/IP boot disk. However, you can use the following procedure to make such a disk. You need only a blank 144MB 3.5" disk, an NT Server 4.0 CD-ROM, MS-DOS network adapter drivers, and a Windows workstation. You need to create a separate boot disk for every different type of network adapter you use.

Step 1
Insert a blank, formatted 3.5" disk into the workstation's drive A.

Step 2
Insert the NT Server 4.0 CD-ROM into the workstation's CD-ROM drive (drive E in this article).

Step 3
Run E:\support\hqtool\makedisk.bat to create an NT 4.0 hardware query disk, which works as an MS-DOS boot disk that you can customize.

Step 4
After makedisk.bat has finished running, go to the 3.5" disk. Remove hardware query components that makedisk.bat has placed on the disk (i.e., A:\zipfile.exe, A:\setramd.bat, A:\dos\findramd.exe, and A:\dos\ramdrive.sys). The boot disk doesn't need the hardware query components, and they consume valuable disk space that you need for the TCP/IP networking components.

Step 5
To ensure that A:\autoexec.bat doesn't reference any files that you removed in Step 4, edit A:\autoexec.bat to contain only

@echo off
prompt $p$g
SET PATH=A:\DOS

Step 6
To prevent errors when config.sys attempts to reference the hardware query components that you deleted, edit A:\config.sys to contain only

DEVICE=A:\DOS\HIMEM.SYS
DEVICE=A:\DOS\EMM386.EXE FRAME=NONE
DOS=HIGH,UMB
FILES=30
BUFFERS=20
LASTDRIVE=Z
STACKS=9,256
SHELL=A:\COMMAND.COM A:\ /E:512 /P

This step completes the creation of the MS-DOS boot disk.

Step 7
Copy the E:\clients\msclient\netsetup folder and its contents to a FAT partition on your local system (drive C in this article) that you can access when you boot from your new boot disk. The system will use the Netsetup files to install the TCP/IP networking component to the disk.

Step 8
Create a folder on drive C and name it NIC_Driver. Copy your network adapter's MS-DOS\Windows for Workgroups (WFW) 3.11 drivers into the NIC_Driver folder. (You can find the drivers on the CD-ROM or disk that came with the adapter or download the drivers from the adapter manufacturer's Web site.) You need at least the two drivers oemsetup.inf and nic_card.dos. If your adapter doesn't have an oemsetup.inf file, copy the drivers that are available, then use the workaround described for this situation when you reach Step 12.

Step 9
Use your newly created boot disk to reboot your machine.

Step 10

Type

C:\netsetup\setup.exe

at the command prompt, then press Enter to start the setup program for Microsoft Network Client 3.0 for MS-DOS. Press Enter again to set up the Network Client software on your boot disk.

Step 11
Select C:\net in the Network Client directory and press Enter. The network setup program creates a C:\net folder and places all the necessary binaries and configuration files into that folder. You specify the local hard disk, not the boot disk, as the file destination because the Network Client setup program copies more than the essential files, and those files take up more space than is available on the boot disk. In later steps, you'll remove superfluous files from the C:\net folder and place the streamlined C:\net folder on your boot disk.

Step 12
A screen that lists network adapters appears. From the list, select the network adapter that your system is using. If your adapter doesn't appear on the list, select Network adapter not shown on list below and press Enter. On the next screen that appears, enter the path to the NIC_Driver folder that you created in Step 8. The next screen that appears displays a list of network adapters that your drivers support. Select your adapter, and when the next screen prompts you, press Enter to select the Setup for best performance option. This option configures the network drivers to use more memory for network buffers.

If you found in Step 8 that your network adapter doesn't include an oemsetup.inf file, you can select any network adapter from the list, manually copy the nic_card.dos driver for your network adapter into the A:\net folder, and copy into A:\net\protocol.ini the entries in the sample protocol.ini file that comes with your nic_card.dos driver. You also need to change the netcard, lana0, and bindings entries in A:\net\protocol.ini to point to the new driver section. Listing 1, page 72, contains a sample protocol.ini file.

After you adjust the protocol.ini file, edit the netcard entry in A:\net\system.ini to point to the new nic_card.dos driver. Listing 2, page 72, shows an example of a system.ini file's [network drivers] section.

Step 13
After you select your adapter, the setup program asks you for a username. Type the domain account that you'll use to connect to the remote share (in this article, the username is Administrator). Press Enter.

Step 14
The next screen that appears, the setup menu, lets you change names, setup options, and network configuration. Select the Change Names option, and on the resulting screen, which Figure 1 shows, set Change Computer Name to a unique name and set Change Domain Name to the domain in which the Administrator user account resides.

Press Enter, and the program returns you to the setup menu. Select Change Setup Options, and on the resulting screen, set Change Logon Validation to Logon to Domain, as Figure 2 shows. Press Enter to return to the setup menu, then select Change Network Configuration. The resulting screen, which Figure 3 shows, contains two boxes; you can press Tab to toggle between the boxes. By default, the NWLink IPX protocol is bound to the network adapter. To add the TCP/IP protocol, shift to the lower box, select Add Protocol, and press Enter. A list of protocols appears. From the list, select Microsoft TCP/IP and press Enter. You return to the previous screen. To remove the NWLink IPX protocol, toggle to the upper box and choose NWLink IPX Compatible Transport. Then, move to the lower box, select Remove, and press Enter. The resulting window will look similar to Figure 3.

If your network doesn't use DHCP to configure clients, you need to change the TCP/IP settings to give your network adapter a static IP address. Select Microsoft TCP/IP in the upper box, then toggle to the lower box and select Change Settings. Press Enter. The resulting screen lets you specify an IP address, subnet mask, and default gateway. To disable the DHCP client, you also need to set Disable Automatic Configuration to 1.

Step 15
Press Enter as many times as necessary to reach the setup menu. On the setup menu, select The listed options are correct, and press Enter. When the setup program prompts you for an OEM driver disk, press Enter again. Then, press F3 to finish setup without rebooting. Eject the boot disk, and reboot to your main OS.

Step 16
To fit the C:\net folder and its contents onto the boot disk, you need to remove all nonessential files. Open the C:\net folder and delete

C:\net\setup.exe
C:\net\sockets.exe
C:\net\nwlink.exe
C:\net\expand.exe
C:\net\ping.exe
C:\net\ipconfig.exe
C:\net\addname.exe
C:\net\win_sock.dll
C:\net\winsock.dll
C:\net\wsockets.dll
C:\net\rascopy.bat
C:\net\vbapi.386
C:\net\vsockets.386
C:\net\readme.txt
C:\net\*.inf

Step 17
Copy C:\net to your boot disk, and use a text editor to replace C:\net with A:\net in the autoexec.bat, config.sys, and system.ini configuration files on the boot disk. For example, change C:\net\autoexec.bat to A:\net\autoexec.bat.

Step 18
Open the A:\net\system.ini file, and find the [network] section. Within that section, replace the workgroup=WORKGROUP line with passwordcaching=no. The boot disk doesn't require the workgroup line, and setting passwordcaching to no ensures that a file on your boot disk doesn't cache your user account password; such a cache might create a security problem in some organizations.

After you complete these 18 steps, you have a TCP/IP boot disk with about 200KB of space to spare. I've used this method successfully with Ethernet and Token-Ring LAN adapters.

If you need boot disks for more than one computer, use the diskcopy.exe command to make copies of your new boot disk. To avoid an identity crisis on your network, you need to change the computername entry in A:\net\system.ini to make each disk unique. If you specified a fixed IP address instead of using DHCP, you need to change the IP address in the TCP/IP section of the A:\net\protocol.ini file to a unique address on each disk you copy.

Your TCP/IP boot disk will let you boot clients to your TCP/IP network and use the Netuse command to map network drives. I commonly use TCP/IP boot disks to roll out a standard client image to multiple machines. When client machines have different hardware, I can map a drive to a network share that contains NT 4.0 installation media and use a boot disk to perform a manual or unattended installation of NT 4.0 onto a machine that doesn't have a CD-ROM drive. Putting all the files I need for booting on one disk makes performing these administrative tasks much easier.

USING A BATCH FILE TO CHECK FOR FILE EXISTENCE
Did you know that it's possible to use a batch file to check for the
existence of a file and then perform a routine when it arrives? This
routine comes in handy when you need to run a program after a file has
been sent via FTP to your computer. To run this routine, type the
following:

:check for file existence
if exist c:\ftp\ftpfile.txt goto perform
sleep 200
goto check
:perform

This routine checks for the existence of the Ftpfile.txt file every 200
seconds. To run this routine, you'll need the Sleep.exe program, which
can be found in the Windows NT Resource Kit.

CALLING A BATCH FILE FROM WITHIN A BATCH FILE

 

To call a batch file from within another batch file, you can use the

Call command. This command enables control to be returned to the

original batch file when the command is finished. For example, the file

below is named Batch.bat:

Batch.bat

@echo off echo Running First.bat

First.bat

echo Return control to First.bat

call Second.bat

echo Running Second.bat

Once First.bat finishes, Second.bat will be called. After Second.bat

finishes, control will be turned over to Batch.bat. The transfer of

control back to Batch.bat enables it to continue with further

instructions.

 

DefPrint is a small utility which allows you to set the default printer from the
command line.

 

At the end of the logon script, you can  run 'defprint lpt1' which sets the
local printer to be default (if it exists)

'defprint /p' shows a list of installed printers.
'defprint /d "printer"' sets the default printer (either the port or share name suffices)
'defprint /?' gives you help

You can always get the latest version at http://www.tardis.ed.ac.uk/~sda/defprint

 

A couple of examples...

D:\>defprint /p
Found 2 printers

PrinterName: \\EDUC-HQ\Comm Ed (North)
ServerName: \\EDUC-HQ
PortName: edu-ce-hp5-2
DriverName: HP LaserJet 5
PrintProcessor: winprint
ShareName: commed-2

PrinterName: \\EDUC-HQ\Comm Ed (South)
ServerName: \\EDUC-HQ
PortName: EDU_COMMED_HP5M
DriverName: HP LaserJet 5
PrintProcessor: winprint
ShareName: commed-1

D:\>defprint /d commed-1
Would set the default printer to commed-1

Equally,

D:\>defprint /d edu_commed_hp5m
would do the same job

D:\>defprint /d lpt1
Would set the default printer to be the local printer (only if it existed)

 

How can I maintain printer information for my domain?

Below is a scipt which will go through the servers you choose in the domain and will dynamically query the servers via ADSI to get the ShareName, PrintDriver, Comment, PrinterPort (IPA, etc...), and PrinterStatus. This script was written by Aaron Shepherd.

Here is the script, in ASP:

<%
sub DisplayPrinterForServer(ServerToDisplay)
dim member, bstrFilter
dim PrintQObj, PrintQClass, computerName
dim item, property
dim aStr, domainMembers, computer, computerFilter

computerName = ServerToDisplay
set bstrNS = getObject("WinNT://" & computerName)

'response.write bstrNS.Name & ": " & bstrNS.class & "<br>"

bstrFilter = array("PrintQueue")
bstrNS.Filter = bstrFilter

response.write "<big><big><b>Printers available at: " & bstrNS.Name
& "</b></big></big><p>"

response.write "<table border=""1"" width=""100%""
align=""center"">"
response.write
"<tr><td><b><big>ShareName:</big></b></td><td><b><big>Print
Driver:</big></b></td><td><b><big>Comment:</big></b></td><td><b><big>Port:</
big></b></td><td><b><big>Status:</big></b></td></tr>"

response.write "<tr>"
for each member in bstrNS
response.write "<td width=""15%""><b>" & Member.name &
"</b></td><td width=""25%""> " & member.model & "</td>"
response.write "<td width=""25%"">" & Member.description &
"&nbsp</td><td width=""20%"">" & Member.PrintDevices & "</td>"

response.write "<td width=""15%"">"
if (Member.Status and &H00000000) <> 0 then
response.write "<b>"
end if

select case Member.Status
case &H00000000: response.write "OK"
case &H00000001: response.write "Paused"
case &H00000002: response.write "Pending Deletion"
case else: response.write "Unknown: " &
Member.Status
end select

if (Member.Status and &H00000000) <> 0 then
response.write "</b>"
end if
response.write "</td>"

response.write "</tr>"
next

response.write "</table>"
end sub

'You will need to adjust depending on the number of servers you are
querying. It takes 600 seconds for 20 servers
Server.ScriptTimeOut = 700

response.write "<big><big><big><b>Printer Queues on Servers in
YourDomain</b></big></big></big><hr><br><b>Note this will take 5 minutes to
load and you will be notified when it is done.</b><br><br>"

DisplayPrinterForServer("server1")
DisplayPrinterForServer("server2")
DisplayPrinterForServer("server3")
DisplayPrinterForServer("server4")
DisplayPrinterForServer("server5")
DisplayPrinterForServer("server6")
DisplayPrinterForServer("server7")
DisplayPrinterForServer("server8")

response.write "<br>Completed ASP processing:"
%>

Retrieve the date and time in batch files
 

Sometimes you need to retrieve the current date and time from within a batch for a command file. For example, say you create a batch file to perform a backup or copy operation and want the program to write the current date and time for specific actions to a log file. Or maybe you've created a batch file that, among other tasks, copies several folders from one location to another, and you want to export the date and time the action is completed to a log file. You have a couple of options for extracting that information: the ECHO command and the Now.exe tool.
 

Extract with the ECHO command
To use the ECHO command in the batch file, you can use the %date% and %time% variables to extract the date and time, and use the > and >> redirection symbols to redirect the text to a file. The > symbol creates a file and >> appends to a file. For example, use the following command to append the date, time, and a message to a text file:
echo %date% %time% File copy operation complete. >> log.txt

The Windows Now.exe tool
Another option is to use the Now.exe tool included with the Windows 2000 Resource Kit. Now.exe extracts the current date and time and displays it on the standard output (by default, the screen). You can use the redirection symbols mentioned above to direct the text to a file. The following is an example that appends the current date, time, and a message to a text file:
Now File copy operation complete. >> log.txt

To use Now.exe in a batch file, install the Windows 2000 Resource Kit and make sure the path variable points to the folder containing Now.exe. Or place it in the folder from which you’re executing the batch file.
 

 

Create a mirror with this batch file
For this process, you'll set up a backup or mirror folder in a location other than the one usually used for storage. Then, you'll use the batch file to copy the documents to that new folder. You'll also use Windows' Scheduled Tasks feature to run the batch file each day.
 
  1. First, you must determine which folder will be backed up. To keep things simple, in the following example I'll assume the main document folder is C:\My Documents (on Windows NT, 2000, and XP machines, you'll want to use the appropriate profile folder). You'll also need to copy Outlook's personal storage file—it's usually called Outlook.pst.
  2. Create the mirror folder. (In this example, it's called D:\mirror.)
  3. Use this sample code to build the batch file. Once you've done so, you'll need to copy it to an out-of-the-way location on the user's hard drive.


Xcopy has evolved
As you can see in the sample code, Xcopy32 introduces many useful switches that didn’t exist in its DOS predecessor. These are the most important ones:
 

/d—This switch copies all source files that are newer than existing destination files. It allows you to update only files that have changed, making the process a lot faster.
/c—This command-line option ignores errors. You don’t want one corrupted file to halt the automated copying.
/s—This option copies directories and subdirectories.
/r—This switch copies read-only files.
/y—Use this switch to overwrite files without prompting. You don't want any user intervention to be required.
/i—Use this option to automatically create new folders on destination.


The > d:\mirror\xcopy.log suffix creates a log file with all of XCopy’s messages, for later reference and troubleshooting. Using >> appends a file to an existing log rather than creating a new one.

Size matters
You'll want to customize this batch file to mirror information that's important to the user, including faxes, Outlook Express e-mail folders, and Office documents. Make sure, however, that it all fits in the destination drive. Even users who frequently clean their files can pile up redundant information. Consider using DOS wildcards to fine-tune this process to each user's needs.
 

Run your backup batch file automatically
To make sure your users' files are actually backed up, use Windows' Scheduled Tasks to schedule the batch file to run each day at a convenient hour. In Windows 98, Scheduled Tasks resides in the System Tray. Windows 2000 and XP hide this feature in the Control Panel.

Once you've opened the Scheduled Tasks window, double-click Add Scheduled Task to invoke the wizard. Click Next to move past the introductory screen. You'll then be asked to select the program you want to schedule. You'll need to browse for your newly created batch file, because Windows defaults to scheduling registered applications.
 

 
Figure A



Once you've chosen your batch file, select a frequency for the file to run, see Figure A.
 


 
Figure B



Next, you'll be prompted to select a time for the task to run, see Figure B.
 


 
Figure C



If prompted, make sure to provide a user name and password, see Figure C.
 


 
Figure D



Finally you'll be shown a summary of your newly scheduled task, as shown in Figure D. Click Finish and your backup batch file will be ready to go.
 

 

Handy diagnostic tools

Windows 2000 carries forward many of Windows NT's familiar TCP/IP diagnostic commands, but the more recent OS also adds several new commands. Whether you're an experienced or novice Win2K administrator, you'll learn a thing or two from this list of top 10 TCP/IP diagnostic commands.

10. Hostname—Hostname is one of the most basic TCP/IP utilities. It displays the name of the system running the command.

C:\>hostname

9. Lpq—The Lpq command displays the status of a remote Line Print Daemon (LPD) print queue. To display the status of a printer named HPLJ4 (identified by the -P switch) on a system named teca4 (identified by the -S switch), enter

C:\>lpq -Steca4 -PHPLJ4

8. Arp—You use the Arp command to view, add, or delete entries in the IP-address-to-physical-network-address translation tables that the Address Resolution Protocol (ARP) uses. To display the cached IP and MAC addresses on your system, enter

C:\>arp —a

7. Ipconfig—The Ipconfig command displays your system's current TCP/IP configuration settings. Ipconfig can also report your current DNS servers' addresses.

C:\>ipconfig /all

6. Netstat—The Netstat command displays your current TCP/IP or UDP connection's status and statistics. Netstat shows both the local and remote name and port of your active network connections. The ? switch displays all the available Netstat switches. To display all active connections in port order, enter:

C:\>netstat -n

5. Route—You can use the Route command to edit or view the IP routing table from the command prompt. Win2K uses the routing table when it needs to find a path to another TCP/IP host. The ? switch displays all the available Route command-line options. To use Route Print to view your system's routing table, enter

C:\>route print

4. Nslookup—The primary command for diagnosing DNS problems, Nslookup is an interactive utility that displays a special command prompt. To display the Nslookup commands, you can enter help at this command prompt. The ls subcommand lists the DNS domain information.

C:\>nslookup

3. Tracert—You use this command to verify that a router path exists between your system and a remote system. Tracert reports the number of hops necessary to reach a given destination. For example, to trace the route to http://www.winnetmag.com, you would enter

C:\>tracert www.winnetmag.com

2. Ping—The Ping command is the most basic TCP/IP network diagnostic tool. If you can't ping a system, you probably won't be able to communicate with that system. To ping a system with the IP address 192.168.100.1, for example, you would enter

C:\>ping 192.168.100.1

1. Pathping—One of Win2K's coolest new TCP/IP tools, Pathping combines the functionality of the Ping and Tracert commands into one handy and robust diagnostic utility. Pathping pings each router between the originating computer and a target destination, then records each hop's duration and packet loss. To use Pathping against http://www.winnetmag.com, enter

C:\>pathping www.winnetmag.com

GRAB THE GUI VERSION OF IPCONFIG

Windows XP, and all previous operating systems that are based on the NT
kernel, uses the IPConfig.exe utility to display TCP/IP protocol
properties, such as IP addresses and default gateways, and to perform some
troubleshooting tasks.

A graphical user interface (GUI) version of this tool, which ships with
Windows 9x and the Window Me system, is also available for Windows XP.
This GUI version of IPConfig.exe is called Wntipcfg.exe, and it's part of
the Windows 2000 Resource Kit. If you don't have the Resource Kit, don't
worry. You can download Wntipcfg.exe for free from Microsoft's Web site.
http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/wntipcfg-o.asp

After you download and install the tool, you may want to consider
creating a shortcut to it on the Desktop or somewhere on the Start menu for
quick, convenient access.

NOTE: The GUI version lacks some functionality of the command line
IPConfig.exe. For example, you can't flush or display the Domain Name System
(DNS) resolver cache or reregister DNS names.

Keep in mind that Windows XP ships with another GUI tool that can
display TCP/IP properties. In Control Panel, click Network and Internet
Connections, Network Connections, Local Area Connection, and the Support tab.

 

Making A Win 9X Boot Disk:

 

You’ll first need to make your disk bootable so you can boot from the disk and use it to access the hard drives on unbootable machines. Open a command prompt window and enter the command Format A: /S. However, you must consider what version of Windows is running on the machine that you’re using to make the disk.
 

Running the Format+ A: /S command copies the Io.sys, Msdod.sys, and Command.com files from the PC to the floppy. These files make the disk bootable and enable the disk to access the contents of a local hard drive. Just remember that different hard drives use different types of partitions. I recommend using a machine running either Windows Me or Windows 98 to create your boot disk. Both of these versions of Windows support FAT-16 and FAT-32 file systems. Although there are versions of Windows 95 that support FAT-32, you’re usually better off using a newer version of Windows for the repair disk creation. But no matter which of these Windows versions you choose, the disk won’t be able to access the contents of NTFS partitions, such as those created by Windows NT, Windows 2000, and Windows XP. If you need NTFS access, I recommend going to the Winternals Software Web site and checking out ERD Commander or NTFSDOS.
Add CD-ROM capabilities
Once you’ve created a bootable disk, you must next make the disk capable of accessing a CD-ROM drive. This is by far the most difficult part of the process, because it involves finding a suitable driver. You need a DOS-based driver that's universally compatible with all IDE CD-ROM drives. But some manufacturers don’t even include DOS drivers with their CD-ROM drives any more. I’ve had the best luck by calling up friends who have old PCs in their offices and copying drivers off of those machines.
I’ve been unable to find a single driver that works with every single drive, but I have a Hitachi driver that comes close. To get around the compatibility problem, I placed several different CD-ROM drivers on my emergency repair disk. I set the disk up so that when I boot the system, I get a boot menu that lists several different choices for drives.
Creating the Config.sys file
So how do you create the Config.sys file? Begin by copying the Mscdex.exe file from the Windows machine’s \WINDOWS\COMMAND folder to the disk. Next, copy the drivers you’ve selected to the disk. Then, create a Config.sys file on the disk that sets up the menu system.
Below is the actual Config.sys file from my emergency repair disk. The [MENU] section sets up the menu colors and the menu items. Notice that each menu item has a two-letter code followed by a description. The description is actually displayed. The code corresponds to one of the bracketed sections below. When you select a menu option, the operating system looks at the code associated with the option and jumps to that section of the file.
The [COMMON] section is reserved for any commands that should be processed regardless of menu choice.
[MENU]
MENUCOLOR=15,1
MENUITEM=AZ, AZI CD-ROM Drivers
MENUITEM=HP, Goldstar CD-ROM Drivers for HP Vectra
MENUITEM=MC, Hitachi CD-ROM Drivers
MENUITEM=BP, Back Pack CD-ROM Drivers
MENUITEM=SY, Sony External CD-ROM Drivers
MENUITEM=NN, No CD-ROM Drivers
[COMMON]
device=himem.sys
device=drvspace.sys
[AZ]
REM AZI CD-ROM Drivers
DEVICEHIGH=a:\SGIDECD.SYS /D:MSCD000
[HP]
rem The following line is for the HP Vectra
DEVICEHIGH=a:\gscdrom.SYS /D:MSCD000
[MC]
REM Standard Hitache CD-ROM Drivers
DEVICEHIGH=a:\d011v110.SYS /D:MSCD000
[BP]
rem the following line is for the backpack CD-ROM
device=a:\bpcddrv.sys /d:bpcddrv$
[SY]
rem the following line is for the external Sony CD-ROM
DEVICE=SLCD.SYS /D:SONY_000 /B:340 /M:P /V /C /E:2
[NN]
rem No CD-ROM Drivers
Tips for creating the perfect Windows boot disk
Page 2 of 2
Creating the Autoexec.bat file
The contents of the Autoexec.bat file will differ widely depending on what you want your disk to do. If you need to be able to use a CD-ROM drive, the Autoexec.bat file must contain a line that loads the Mscdex.exe file.
Below, I’ve included my actual Autoexec.bat file. Notice that I’ve begun the file with a few common commands, followed by the Goto %Config% command. This command tells the file that the Config.sys file contained a menu. Below that line, you’ll see the same two letter codes that I used before. Below each code is the appropriate Mscdex.exe command for the given driver. At the end of the file is an End statement. This statement simply tells Autoexec.bat that this is the end of the menu choices, not the end of the file. So you can place additional commands that would be processed regardless of menu choice below the End command.
@echo off
prompt $p$g
path=a:\;c:\windows\command;c:\windows
GOTO %CONFIG%
 

:AZ
REM AZI CD-ROM Driver
mscdex /d:mscd000
GOTO END
:HP
REM Goldstar CD-ROM Driver for HP Vectra
mscdex /d:mscd000
GOTO END
:MC
REM Hitachi CD-ROM Driver
mscdex /d:mscd000
GOTO END
:BP
REM Back Pack CD-ROM Driver
MSCDEX /D:BPCDDRV$
GOTO END
:SY
REM Sony CD-ROM Driver
MSCDEX /D:SONY_000
GOTO END
:NN
REM No CD-ROM Driver
GOTO END
:END
Rem End of file
Add utility files
The last step of the process is to put some files on the disk that will be beneficial to you in crisis situations. Ideally, it would be nice to include the entire contents of the \WINDOWS\COMMAND folder. However, a floppy disk has a very limited capacity, so you must pick and choose which files to include. I’ve experimented a lot over the years, and determined the following files to be of the most benefit to me:
Attrib.exe
Chkdsk.exe
Deltree.exe
Device.com
Diskcopy.com
Doskey.com
Edit.com
Edit.hlp
Extract.exe
Fdisk.exe
Format.com
Himem.sys
Mem.exe
Mode.com
More.com
Mscdex.exe
Scandisk.exe
Sys.com
Xcopy32.exe
Xcopy.exe