Tips Computer Tips

dot.gif (841 bytes) MS-Office Tips dot.gif (841 bytes) Word 97 Tips dot.gif (841 bytes) Windows Registry
Cable

Windows NT/2000 Tips

Schedule a Reboot on a regular basis
Using the shutdown command from the Windows NT Resource Kit and the AT command scheduler, you can schedule a reboot whenever you need one to occur. Simply set the command line for the AT command to shutdown /r /l /c /y, and the server will automatically reboot. The /r flag for shutdown reboots the server, the /l flag specifies the local machine, /c closes all programs, and /y eliminates the need for a prompt.

Locate the Installation Key
If you ever lose the installation key for Windows NT, you'll be out of luck when you try to reinstall it later. To quickly find a copy, open the System Control Panel. The CD Key is digits 6-15 of the line below the company name on the General tab.

Delete the Recent Documents from a batch file
To delete the list of recently opened documents from the Start menu, simply run the following command:
Del %systemroot%\profiles\%username%\recent\* /q

%systemroot% resolves to the installed location of Windows NT, %username% resolves to the currently logged-on user, and the /q switch does the task without prompt.

Permanently Disable Hidden Administration Shares
The C$, D$, etc. shares can pose a security risk on your systems, since they're widely known among NT hackers. The problem is that when you delete these shares, they're re-created after every reboot. To disable the shares altogether, make the following change to the registry. (Remember that working with the registry does include risks, so make sure you have a verified backup before beginning.)
* HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
\LanManServer\Parameters\AutoShareServer
* Change the value of this key to 0.

For workstations, the key is AutoShareWks.

Use IPC$ to Administrate
It can be a major security risk to always be logged on as a domain
administrator. When you walk away from your machine, even for a short time, you open yourself up to security breaches. Instead, log on to your workstation as a regular user and connect to a server with the IPC$ share when you need administrative privileges.

The syntax is as follows:
Net use \\thePDC\IPC$ /user:domain\AdminAcct AdminPasswd
When you're finished with your administration task, issue the following command:
Net use \\thePDC\IPC$ /d
This will get you back to your user-level account.

Change the Default Screen Saver
When you leave your server logged off, the logon screen saver will kick in after the designated amount of time has passed. You can change the screen saver shown with a simple change to the registry.
REGEDIT4
[HKEY_USERS\.DEFAULT\Control Panel\Desktop]
"ScreenSaveActive"="1"
"Scrnsave.exe"="c:\winnt\black16.scr"
"ScreenSaveTimeOut"="600"

You can specify any other screen saver by changing the path of Scrnsave.exe to any .scr file. C:\winnt\system32\scrnsaver.scr will also blank out the screen. The timeout above is for 600 seconds (10 minutes), but it can also be changed by setting a new value. It's recommended that you use blank screen savers on a server to preserve clock cycles.

Ugly Guys Love Pizza!
The mnemonic phrase above is an easy way to remember your user and group structure: U>G>L<P. When you create a user, place him or her in a global group. Place global groups in local groups. Assign permissions to the local groups.

This is necessary when running a multi-domain model of any type. The global groups are visible to all domains, while local groups are visible only to the local domain. This method allows you to easily add users to groups throughout the system via the appropriate global groups

Hide Shares
Any share that you create can be hidden from the network browser with a simple keystroke. Just as you can hide the IPC$, C$, and other administrative shares, you can also hide a user share by simply adding a $ at the end of the name. By doing so, you hide the share from anyone browsing in Network Neighborhood, but you can still map to the share by typing its name directly. This same trick can be used for hiding an NT printer share.

Synchronize your computers!
You can easily synchronize your system's time with that of the server by using the Net Time command.
Net Time \\YourServer /set /yes

This command will synchronize your workstation's time with the server's and set it according to your time zone. The time zone factor will work only in Windows NT. Windows 9x will not recognize the time zone difference, so you'll need to synchronize with a server in your time zone.

RPC Unavailable Error
When adding a printer, you may see the error, "Operation could not be completed. The RPC Server is unavailable." Typically, this means that the Spoolss.exe or Spoolss.dll has been corrupted. You'll need to replace these files with working copies. The best way to do this is by reapplying the last service pack.

Print More with LPR
If you use LPR to connect your printers to the server in NT, you may notice that printers with heavy traffic will slow down. This may be because of the default settings of LPR on your system. By default, LPR is set to use 11 ports to print on. Once printed on, a port can take several minutes to become available again. To fix this, apply Service Pack 3 or later and make the following changes to the registry.

In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\LPDSVC\lpr, look for the IP address of the LPR printer. Change the value from 0 to 1 to enable all ports greater than 1024.

If you've installed Service Pack 4 or greater, go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\LPDSVC and save the lpr key to an external file. Then delete the lpr key altogether. Re-add the lpr key to the system, add the REG_DWORD value UseNonRFCPorts to the key, and set the value to 1.

After applying the patch, run NET STOP SPOOLER and NET START SPOOLER to restart the printer system. Your printers will now print continuously.

Windows 95/98 Tips

Start Windows Applications with Batch Files
If you use batch files to start applications for your users in order to maintain a common environment, you may find the Start.exe command a useful addition to your scripts. Using the Start command to run your applications gives you a way to ensure that applications are always started maximized or minimized when called from a batch file. Use the syntax:
start /max application.exe
or
start /m application.exe
to start the application maximized or minimized, respectively. If you remember the tip that explained how to use the
explorer .
and
explorer ..
commands to open up an explorer window of the current or parent folder, you may not be too surprised to learn that
start .
and
start .. do exactly the same things (though of course you can also use the /m and /max switches).

By using the Start.exe command with the /w option, you force the batch command that has started the called application to wait until that application closes before processing the next command. For instance, the command start /w f:\customapp.exe would start the application customapp and then halt until the customapp program had finished before carrying on with the next command in the batch file.

The /w option gives you a very basic method of directing users through a series of steps--for instance, directing them to run a particular application once a week in their logon scripts

Start Documents from the Command line
In addition to its other uses, the Start command will look up document extensions, such as .doc for Word or WordPad and .xls for Excel. For example,
Start /max f:\docs\staffmovements.doc
will start the staffmovements.doc document, maximized, using the application that is registered to start .doc files.
In addition, batch files can easily accept document names as variables. For example,
Start /max /w f:\docs\%1
provides a good method of calling a document open from a regularly run batch file. Simply add the document name as a variable after the name of the batch file.

Keep Typing Errors Down
When writing command scripts that involve calling up applications from a complex file system, you can cut down on your typing and minimize mistakes at the command prompt by following this simple tip.
Open a command prompt window and an Explorer window, making sure you can see the application you require in the latter window. Now drag the application file into the command prompt window. The complete path will appear at the current command prompt.

This trick even works with the COPY CON method of creating batch files at the command prompt. Once you've started a new line, the dragged file will appear as the next command, complete with its path--and no spelling mistakes!

Cut and Paste from the Command Prompt
If you've come to Windows 98 from Windows 3.x and even DOS, you probably remember how to create a snapshot of the results of a command line program by redirecting its output to a file. Lost already? Type dir *.* >dir.txt and you create a file in the current folder named dir.txt, which contains the list of files from the dir command as it would have appeared on the screen. This has been the way of passing on this type of output to others for many a year, but it can be done more easily.

Open a command prompt window and make sure you have the toolbar open. If the toolbar isn't displayed, click the MS-DOS icon for the Control menu at the top left of the window, and click the Toolbar icon. Click the Mark icon and then drag the mouse over the text contents of the window to highlight it. Now click Copy. The selection is copied to the standard Windows clipboard, ready to be pasted into any Windows application. This method has to be easier than redirecting to a file first.

Similarly, when you're viewing a text document in Notepad or Word, you can paste into the command prompt any commands that appear in the text, saving yourself the trouble of typing them.

Create a Desktop Shortcut for your Screen Saver
Creating a shortcut to a screensaver program is pretty easy, and it works in Windows 95, 98, and NT. Just click Start, choose Find, and then select Files or Folders. Then, when the Find dialog appears, type *.scr in the Named field and search the entire hard drive. That step should display a list of all the screensavers installed on your system.

Right-click on the appropriate screensaver file and choose Create Shortcut from the menu. (The shortcut doesn't know or care if password protection has been enabled.)

Windows will remind you that it can't create the shortcut in the Find window, and it will ask if you want to put it on the desktop instead. Since that's exactly where you want it, click yes. Then all you or your users have to do is double-click the shortcut to that program to launch your screensaver instantly.

Binding more than one IP Address to a Single NIC
In unusual circumstances, you may need to bind more than one statically assigned IP address to a single network card in a Windows 9x computer. While the GUI of the Networks applet in Control Panel allows you to enter only one IP address and associated subnet mask, you can enter more addresses directly into the registry.

Using Regedit.exe and the usual amount of care, navigate to:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\
Class\NetTrans\

You should find keys there named 0000, 0001, 0002, and so on. If the PC has only one network card, the active key should be 0000. This key should have values of IPAddress and IPMask set to the PC's current address and mask. You can add to the values in these keys using a comma and no extra spaces, as in "192.168.0.122,10.10.10.5" and "255.255.255.0,255.0.0.0".

Note that you should enter a subnet mask for each IP address so that pairs can be built up. When you have made your changes, close Regedit and restart the PC. Note that Winipcfg.exe will display a builder button to allow you to switch between the addresses to view them.

Windows Environment Variables
The SET command, only carries variables from the current MS-DOS prompt session. You may use the Winset.exe utility from the Windows 98 Resource Kit whitch lets you assign a variable that's set globally for the OS until the system is restarted. Try this to see the effect:

1. Open a MS-DOS prompt window and type set testvar=c:\windows.
2. Type set. The variables will be listed, including testvar. Leave that window open and start another MS-DOS prompt window.
3. Type set, and within the displayed list of variables, you'll no
longer see testvar.

If you repeat this exercise typing winset testvar2=c:\windows, you'll see the opposite happen. The testvar2 variable will not appear in the first MS-DOS prompt but will appear if you open a second MS-DOS prompt.

If you want to set a variable for both the current MS-DOS prompt session and globally, remember then to use both statements:
set testvar=c:\windows
winset testvar=c:\windows

Source: TechRepublic


Home Page Back to M.I.S.


Last modified: October 31, 2005
Yannis Grammatis