Monday, December 22, 2008

Turn OFF/ON Firewall - start>run

Disable:
netsh firewall set opmode disable

Enable:
netsh firewall set opmode enable

Network connections Icons Missing in Windows

Verify that the network DLL files are registered correctly:

  1. Click Start, and then click Run.
  2. In the Run box, type cmd.exe, and then click OK.
  3. Type the following lines. Press ENTER after you type each line. This command text is difficult to type. Be sure that you type it exactly as it appears below. Or you may find it easier to copy and paste the text instead. Click OK when the RegSvr32 dialog box appears for each command.

    regsvr32 netshell.dll
    regsvr32 netcfgx.dll
    regsvr32 netman.dll
  4. Restart the computer. Check to see whether your networking icons appear.
[OR]

Method 1: Let Windows automatically detect and install network adapters

  1. Right-click My Computer, and then click Properties.
  2. Click the Hardware tab, and then click Device Manager.
  3. To see a list of installed network adapters, expand Network adapter(s). Click to locate the network adapter, and then click Uninstall.
  4. Restart the computer, and then let the system automatically detect and install the network adapter drivers.
Method 2: Verify network settings and servicesTo verify network settings and services, follow these steps:
  1. Verify that the correct network adapter is selected. A network adapter is a device that enables you to connect a computer to a network. It is also known as a network interface card (NIC).
    1. Right-click My Computer, click Properties, click the Hardware tab, and then click Device Manager.
    2. Double-click Network adapters, and then verify that the correct network adapter name is selected. If you do not know the name of your network adapter, don't worry. For now, just make sure that an adapter is selected.
    3. Double-click the network adapter, and then verify that the "This device is working properly" message appears in the Device status box on the General tab. If you do not see this message, click Troubleshoot, and follow the directions.
    4. After you confirm that the correct network adapter is selected and is working properly, you can close all the open dialog boxes.

  2. Verify that the necessary services are started. The Services settings simply direct the system to stop, start, and administer system services.
    1. Right-click My Computer, and then click Manage.
    2. Double-click Services and Applications, and then click Services.
    3. In the right pane, look at the Status column. You may need to expand the box so that you can see all the columns. Make sure that the following services are started:
      • Remote procedure call (RPC)
        (This service must be started before other services can take effect.).
      • Network Connections
        (This service can only start if the RPC service is active.)
      • Plug and Play
      • COM+ Event System
        (This service can only start if the RPC service is active.)
      • Remote Access Connection Manager
        (This service can only start if Telephony service is active.)
      • Telephony
        (This service can only start if the RPC service and the PnP Service are active.)
    4. To start a service, right-click the service name, and then click Start.
    5. Do not close the Computer Management box because you will need to check additional settings in the remaining steps.

Saturday, December 20, 2008

Logon - Logoff issue in Windows XP - Immediate Logout after Login

1.Enter the Recovery Console

2. Boot the system using the Windows XP CD-ROM. In the first screen when the Setup begins, read the instructions press "R" (in the first screen) enter the Recovery Console.

3.Type-in the built-in Administrator password to enter the Console. You'll see the prompt reading C:\Windows (Or any other drive-letter where you've installed XP)

4.Type the following command and press Enter. CD SYSTEM32
(If that does not work, try CHDIR SYSTEM32)

5.COPY USERINIT.EXE WSAUPDATER.EXE
Quit Recovery Console by typing EXIT and restart Windows.

You'll be able to login successfully as you've created the wsaupdater.exe file (now, a copy of userinit.exe) Now, change the USERINIT value in the registry (see Phase II in this page) and change it accordingly.

Phase II - Fixing a registry entry which causes the Quick Launch issue (not retaining the settings)

Click Start, Run and type REGEDIT. Navigate to:
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ WindowsNT \ CurrentVersion \ Winlogon

In the right-pane, change the value of Userinit to "C:\WINDOWS\system32\userinit.exe,"

Type the above value exactly as given, including the comma - exclude the quotes. Also, change the path to userinit.exe appropriately if Windows is installed in a different drive.

Close Registry Editor and restart Windows. The Quick Launch settings should be retained now.

Advanced troubleshooting - Diagnostic and Selection startup modes

To perform a diagnostic startup, follow these steps:
1. Click Start, click Run, type msconfig, and then click OK.
2. On the General tab, click Diagnostic Startup, and then click OK.
3. Restart your computer.
If the problem does not occur, use Selective startup mode to try to find the problem by turning individual services and startup programs on or off.

Selective startup:
Selective startup enables you to select the files and the settings that you want the computer to load when you restart the computer. Select from the following options:
• Process System.ini File
• Process Win.ini file
• Load System Services
• Load Startup Items
By default, no options are selected. The following actions apply to these options:

To perform a selective startup, follow these steps:

1. Click Start, click Run, type msconfig, and then click OK.
2. On the General tab, click Selective Startup.
3. Select or clear the available settings.
4. Click OK.
5. Restart your computer.
6. Repeat steps 1 through 5 until you find the problem.

Change individual file settings :
1. Click Start, click Run, type msconfig, and then click OK.
2. Click a tab: System.ini, Win.ini, Boot.ini, Services, or Startup.
3. Select or clear the available settings.
4. Click OK.
5. Restart your computer.
6. Repeat steps 1 through 5 until you find the problem.

System.ini and Win.ini options:
• Check boxes enable you to enable or to disable an option. To enable an option so that it loads at startup, select the check box or select the option, and then click the Select button. To disable an option so that it does not load at startup, clear the check box or select the option, and then click the Disable button.
Note When you click to clear a check box for an item or a line, the Selective Startup option on the General tab is automatically selected.

Manually extract a file:
If you have to fix a corrupted file, extract the individual Windows file from the CAB files. To do this, follow these steps:
1. Click Start, click Run, type msconfig, and then click OK.
2. On the General tab, click Expand File.
3. In the File to restore box, type the name of the file that you want to restore.
4. In the Restore from box, type the path of the Windows XP .cab file from which you want to restore the file. Or, click Browse From to locate the Windows XP .cab file.
Note The Windows XP .cab files are stored in the I386 folder on the Windows XP installation CD.
5. In the Save file in box, type the path of the folder to which you want to extract the new file. Or, click Browse To to locate the folder that you want.
6. Click Expand.
7. In the System Configuration Utility dialog box, click OK. If you are prompted to restart the computer, click Restart.

Return to normal startup:
After you complete your troubleshooting and fix your configuration, return to a normal startup. Follow these steps:
1. Click Start, click Run, type msconfig, and then click OK.
2. On the General tab, click Normal startup.
3. Click OK.
4. Restart your computer.

Msconfig > Boot.ini > Options:
Microsoft recommends that you don’t attempt to use MSCONFIG to edit BOOT.INI unless you’re directed to do so by a Microsoft support professional.
Three of the four buttons provided in this window are for editing purposes and are grayed out by default. The Check All Boot Paths

Boot tab summary:Safe boot
* Minimal - Safe mode
* Alternate shell - Safe mode with Command Prompt
* Active Directory repair - Directory Services Restore mode (domain controllers only)
* Network - Safe mode with networking
Note: This does not load the network configuration, but instead loads a generic TCP/IP network configuration.

No GUI boot - When this option is selected, the VGA video driver responsible for presenting bitmapped graphics during the Windows startup process is not initialized. The driver is used to display startup progress information and error messages. Disabling this disables Windows ability to do those things.

Boot log - Enable Boot Logging. This is the mode to use when you are debugging problems that are regularly reproducible.

Base video - The computer starts up using the standard VGA video driver. Use this switch if you have installed a graphics driver that is not working.

OS boot information - Displays the driver names while they are being loaded. Use this switch if Windows does not start up and you believe that a driver is missing.

Boot option pane :
The most valuable functions on the BOOT.INI tab are the boot options, which are explained below. You can use these five choices for a variety of troubleshooting techniques.
  • /SAFEBOOT gives you four suboptions for starting the computer.
  • /SAFEBOOT with MINIMAL starts the computer in Safe Mode.
  • /SAFEBOOT with NETWORK starts the computer in Safe Mode with networking support.

  • Note
    /SAFEBOOT with NETWORK does not load the normal network configuration; instead, it loads a generic TCP/IP network configuration.
  • /SAFEBOOT with DSREPAIR is used to repair Directory Services on Domain Controllers.
  • /SAFEBOOT with MINIMAL (ALTERNATESHELL) starts the computer in Safe Mode with Command Prompt.
  • /NOGUIBOOT starts the computer without the VGA video driver that displays graphics during the boot process and Blue Screen crash information.
  • /BOOTLOG enables boot logging to help you debug and troubleshoot startup problems.
  • /BASEVIDEO starts the computer using a standard VGA video driver, as opposed to the one installed for the graphics card.
  • /SOS causes the driver names to be displayed when they’re loaded. You can use this switch to diagnose driver-related issues.
Figure E

The BOOT.INI Advanced Options screen, shown in Figure E, offers you four more options for starting your computer.
  • /MAXMEM limits the amount of memory that Windows XP can use. You can use this switch if you believe that your system has a bad memory chip.
  • /NUMPROC limits the number of processors used in a multiprocessor system.
  • /PCILOCK stops Windows XP from dynamically assigning system resources to PCI devices. The devices will use the BIOS configuration instead.
  • /DEBUG starts the computer in debugging mode. It allows you to configure the machine with three additional suboptions, as follows:
  • /DEBUG with /DEBUGPORT specifies the communications port to be used for debugging.
  • /DEBUG with /BAUDRATE specifies the baud rate to be used for debugging. The default baud rate is 9600 with a modem and 19200 with a null-modem cable.
  • /DEBUG with /CHANNEL specifies the 1394 communications channel for debugging.
Working with the Services tab:
The MSCONFIG Services tab, shown in Figure F, allows you to prevent specific services from starting when the computer is started. This is extremely useful when you’re troubleshooting service-related problems.

Microsoft has designed the majority of services in Windows XP. To make it easier to find a non-Microsoft service, you can select the Hide All Microsoft Services option.


Troubleshooting using the Startup tab:
The Startup tab lets you prevent items in your startup folder from starting when you log in. As you can see in Figure G, you can simply deselect the service to prevent it from starting. If you want to disable all the services, click the Disable All button. To enable all the services again, click the Enable All button.

System restore : Windows XP

You can use the System Configuration utility to perform a system restore. There are three possible restore points:
• System checkpoints that Windows schedules
• Manual restore points that you specify with the System Configuration utility
• Installation restore points that occur before you install a program or a service
You can use the system checkpoints or the installation restore points to restore your computer's settings to a date when it operated correctly. This may also help determine the cause of the configuration error.

To perform a system restore, follow these steps:
1. Click Start, click Run, type msconfig, and then click OK.
2. On the General tab, click Launch System Restore.
3. Select Restore my computer to an earlier time, and then click Next.
4. Calendar dates in bold are possible restore points. Click the most recent one to view system restore information.
5. Select a system checkpoint or an installation restore point, and then click Next.
6. Close all other programs.
7. To start the system restore, click Next.
8. Your computer restarts.
9. Repeat steps 1 through 8 until you fix your configuration issue.

FIX & Bootcfg Commands on Recovery Console

# Fixboot writes a new startup sector on the system partition:

ex: fixboot c:

Use this command to write the new Windows boot sector code on the system partition. In the command syntax, drive name is the drive letter where the boot sector will be written. This command fixes damage in the Windows boot sector. This command overrides the default setting, which writes to the system boot partition. The fixboot command is supported only on x86-based computers.

# Fixmbr repairs the startup partition's master boot code:
The variable device is an optional name that specifies the device that requires a new Master Boot Record. Omit this variable when the target is the startup device.

fixmbr \device\harddisk2

Fixmbr Command Syntax: fixmbr (device_name)

device_name = This is where you designate the exact drive location that a master boot record will be written to. If no device is specified, the master boot record will be written to the primary boot drive.
Fixmbr Command Examples: fixmbr \Device\HardDisk0

In the above example, the master boot record is written to the drive located at \Device\HardDisk0. In this example, the master boot record is written to the device that your primary system is loaded onto. If you have a single installation of Windows installed, which is normally the case, running the fixmbr command in this way is usually the right way to go.

# Bootcfg modifies the Boot.ini file for boot configuration and recovery.

What Is the Bootcfg Command?:

The bootcfg command is a Recovery Console command used to build or modify the boot.ini file, a hidden file that is used to identify in what folder, on which partition, and on which hard drive Windows is located.
Bootcfg Command Syntax: bootcfg /list
/list = This option will list every entry in the boot list in the boot.ini file.

bootcfg /scan
/scan = Using this option will instruct bootcfg to scan all drives for installations of Windows and then display the results.

bootcfg /rebuild
/rebuild = This option will step you through the process of rebuilding the boot.ini file.

bootcfg /default
/default = the /default switch sets the default boot entry in the boot.ini file.

bootcfg /add
/add = This option allows for the manual entry of a Windows installation in the boot.ini boot list.

bootcfg /rebuild
In the above example, the bootcfg command scans all drives for any Windows installations, displays the results, and steps you through building the boot.ini file.

#Diskpart What Is the Diskpart Command?:
The diskpart command is a Recovery Console command used to create or delete partitions on hard drives.
Diskpart Command Syntax: diskpart /add
/add = The /add option will create a new partition on the specified hard drive.

diskpart /delete
/delete = This option will remove a specified partition on a specified hard drive.
Diskpart Command Examples:

diskpart /add \Device\HardDisk0 5000

In the above example, the diskpart command creates a 5,000 MB partition on the hard drive located at \Device\HardDisk0.

diskpart /delete \Device\HardDisk0\Partition1

In the above example, the diskpart command will remove the Partition1 partition located on the hard drive \Device\HardDisk0.

diskpart /delete G:

In the above example, the diskpart command will remove the partition currently assigned the drive letter

Missing or Damaged Driver File

Use Recovery Console to replace the missing or damaged driver file. To do so, follow these steps:
1. Insert the Windows XP CD-ROM into the CD-ROM or DVD-ROM drive, and then restart the computer. Select any options that are required to start the computer from the CD-ROM or DVD-ROM drive if you are prompted to do so.
2. When the "Welcome to Setup" screen appears, press R to start Recovery Console.
3. If your computer is configured for dual booting or multiple booting, select the relevant Windows XP installation.
4. When you are prompted to do so, type the administrator password, and then press ENTER.
Note In Windows XP Home Edition, the administrator password is\ blank by default.
5. At the command prompt, type the following command, and then press ENTER:
cd windows\system32\drivers
6. To rename the damaged driver file, type the following command, and then press ENTER
ren drivername.sys drivername.bak
where drivername is the name of the damaged driver file.
7. To copy the driver from the Windows XP CD-ROM to the Drivers folder, type the following command, and then press ENTER
copy cd-rom:\i386 drivername
where cd-rom is the drive letter for the drive that contains the Windows XP CD-ROM.
8. Type exit, press ENTER, and then restart the computer.

Missing or Damaged User32.dll File

Use Recovery Console to replace the corrupted or damaged User32.dll file, then, if needed, perform an in-place upgrade (also called a repair install) of Windows XP. To do so follow these steps:
1. Insert the Windows XP CD-ROM into the CD-ROM or DVD-ROM drive, and then restart the computer. Select any options that are required to start the computer from the CD-ROM or DVD-ROM drive if you are prompted to do so.
2. When the "Welcome to Setup" screen appears, press R to start Recovery Console.
3. If your computer is configured for dual booting or multiple booting, select the relevant Windows XP installation.
4. When you are prompted to do so, type the administrator password, and then press ENTER.
NOTE: In Windows XP Home Edition, the administrator password is\ blank by default.
5. At the command prompt, type the following command, and then press ENTER:
cd windows\system32
6. To rename the User32.dll file, type the following command, and then press ENTER:
c:\windows\system32\ren user32.dll user32.bak
7. To expand a new copy of the User32.dll file from the Windows XP CD-ROM to the System32 folder, type the following command, and then press ENTER:
expand cd-rom:\i386\user32.dl_ c:\windows\system32
where cd-rom is the drive letter for the drive that contains the Windows XP CD-ROM, and c:\windows is the drive letter and folder in which Windows XP is installed.
8. Type exit, press ENTER, and then restart the computer.
If Windows XP still fails to start, you may need to perform an in-place upgrade (also called a repair install)

Black startup screen is briefly displayed and your computer restarts repeatedly when you try to start Windows XP

A fatal system error (STOP error) causes the computer to stop.

The Automatically restart option is selected under System failure in the Startup and Recovery dialog box in System Properties.

The Windows XP paging file is smaller than the amount of physical memory that is installed on the computer, or there is insufficient free space on the hard disk to write the error dump file (Memory.dmp).

Method 1

1.

Try to replace the registry hives from the repair directory by using the Recovery Console, and then restore the system to a current state with System Restore.

Method 2

1.

Install Windows XP to a different folder.

2.

Click Start, and then click Run.

3.

In the Open box, type regedit, and then click OK.

4.

Browse to the following registry subkey:

HKEY_LOCAL_MACHINE

5.

On the File menu, click Load Hive.

6.

Navigate to the System file in the original Windows XP installation location.
By default, the System file is stored in the following location:

%SystemRoot%\System32\Config\System

7.

Type an arbitrary name when you are prompted for a key name in the Load Hive dialog box.
The original HKEY_LOCAL_MACHINE hive is loaded as a subkey of the current key.

8.

In the arbitrary name key (where arbitrary name is the name that you assigned the HKEY_LOCAL_MACHINE registry key from the original Windows installation), browse to the following registry subkey:

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CrashControl

9.

In the right pane of the Registry Editor window, double-click AutoReboot.

10.

In the Value data box, type 0 (zero), and then click OK.

11.

Click the minus sign to collapse the HKEY_LOCAL_MACHINE registry subkey.

12.

On the File menu, click Unload Hive.

13.

On the File menu, click Exit.


Method 3 :

1.

Click Start, and then click Run.

2.

In the Open box, type regedit, and then click OK.

3.

Browse to the following registry subkey:

HKEY_LOCAL_MACHINE

4.

On the File menu, click Load Hive.

5.

Navigate to the System file in the original Windows XP installation location. By default, this is stored in the following location:

%SystemRoot%\System32\Config\System

6.

Type an arbitrary name when you are prompted for a key name in the Load Hive dialog box.
This loads the original HKEY_LOCAL_MACHINE hive as a subkey of the current key.

7.

In the arbitrary name key (where arbitrary name is the name that you assigned the HKEY_LOCAL_MACHINE registry key from the original Windows installation), browse to the following registry subkey:

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Memory Management

8.

In the right pane of the Registry Editor window, double-click PagingFiles.

9.

In the Value data box, edit the first numeric value after c:\pagefile.sys (where c: is the drive on which the pagefile is stored) to increase it to a number that is at least 1 MB greater than the amount of physical memory in the computer.
NOTE: Do not type a number that is greater than the amount of free hard disk space on the computer.
For example, the following value displays a minimum paging file size of 130 MB and a maximum paging file size of 256 MB.

c:\pagefile.sys 130 256

10.

Click OK.

11.

Browse to the following location in the registry hive that you loaded from the original Windows installation:

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CrashControl

12.

In the right pane of the Registry Editor window, double-click CrashDumpEnabled.

13.

Type 1 (one) in the Value data box if it is not already present, and then click OK.

14.

Click the minus sign to collapse the HKEY_LOCAL_MACHINE registry subkey.

15.

On the File menu, click Unload Hive.

16.

On the File menu, click Exit.

17.

Attempt to start the original Windows XP installation. When the STOP error occurs, the memory dump information will be stored in the paging file.

18.

Restart the computer and select the parallel installation of Windows XP. This allows the dump file to be created and you may be able to use the information to resolve the problem that causes the STOP error message in the original installation.
NOTE: The dump file is saved in the %SystemRoot%\Memory.dmp file, where %SystemRoot% is the parallel installation system folder.

19.

Click Start, right click My Computer, and then click Properties.

20.

Click the Advanced tab, click Settings under Startup and Recovery.

21.

Click to clear the Automatically restart check box, click OK, and then click OK again.

22.

Restart the computer. When you attempt to shut down the computer, the exact message should be displayed.

You receive a "System Has Recovered from a Serious Error" message after every restart

You can solve this problem by recreating the pagefile. To re-create the pagefile, follow these steps:
1. Click Start and Right-click My Computer Properties.
2. On the Advanced tab, in the Performance section, click Settings.
3. In the Virtual Memory section, click Change.
4. For Paging file size for selected drive, click No Paging File, and then click Set.
5. Click Yes after the following warning appears:
If the paging file on volume X: has an initial size of less than xx megabytes, then the system may not be able to create a debugging information file if a STOP error occurs. Continue anyway?

(X is the drive letter and xx is the amount of RAM installed on your computer minus 1 megabyte.)
6. Click System Managed Size.
7. Click OK four times, and then restart the computer when you are prompted.

HAL.DLL is Missing or Corrupted

Option 1 :Boot from your CD and follow the directions to start Recovery Console. Then:

Attrib -H -R -S C:\Boot.ini
DEL C:\Boot.ini
BootCfg /Rebuild
Fixboot

Option 2: Boot from your CD and follow the directions below to start Recovery Console.

Most likely you will need to expand the file from the CD. The command would be

c:\windows\d:

d:\expand d:\i386\hal.dl_ c:\windows\system32\hal.dll

Substitute d: for the drive letter of your CD. Once you have expanded the file type “exit” to exit the Recovery Console and restart the computer.

Missing or corrupt ntoskrnl.exe file

NTOSKRNL.EXE is missing or corrupt. startup environment.

If the ntoskrnl.exe file is corrupt or missing this can also generate the error. To restore this file follow the below steps.

  1. Insert the Microsoft Windows XP CD. Note: If you have a recovery CD or a restore CD and not a Microsoft Windows XP CD it is likely the below steps will not resolve your issue.
  2. Reboot the computer, as the computer is starting you should see a message to press any key to boot from the CD. When you see this message press any key.
  3. In the Microsoft Windows XP setup menu press the R key to enter the recovery console.
  4. Select the operating system you wish to fix, and then enter the administrator password.
  5. Type expand d:\i386\ntoskrnl.ex_ c:\windows\system32
  6. You will then be prompted if you wish to overwrite the file type Y and press enter to overwrite the file.
  7. Type exit to reboot the computer

Create Instant System Restore Point

---open Notepad > type & save the below lines with a filename xxx.vbs & run it----

'Unattended System Restore Point
'sysrestorepoint.vbs
'© Doug Knox - rev 02/11/2002
'Downloaded from www.dougknox.com
'Extracted from original code by Bill James - www.billsway.com

Set sr = getobject("winmgmts:\\.\root\default:Systemrestore")

msg = "New Restore Point successfully created." & vbCR
msg = msg & "It is listed as: " & vbCR
msg = msg & "Automatic Restore Point " & Date & " " & Time

'Put a ' in front of the next five lines to disable the Success Failed Prompt.
If (sr.createrestorepoint("Automatic Restore Point", 0, 100)) = 0 Then
MsgBox msg
Else
MsgBox "Restore Point creation Failed!"
End If

'Remove the ' from the next 3 lines to only alert you if the process failed
'If (sr.createrestorepoint("Automatic Restore Point", 0, 100)) <> 0 Then
' MsgBox "Restore Point creation Failed!"
'End If

USB2 Test

---open Notepad > type & save the below lines with a filename xxx.vbs & run it----

On Error Resume Next
'The presence of the following key seems to indicate USB 2
RegKey = "HKLM\SYSTEM\CurrentControlSet\Enum\USB\ROOT_HUB20"

'Attempt to read the key
CreateObject("WScript.Shell").RegRead(RegKey & "\")

If Err Then
'An error is always returned when there is no default value, so
'check for specific error message returned for missing key
If InStr(LCase(Err.Description), "invalid root") > 0 Then
MsgBox "This computer does not seem to be USB 2 enabled."
Else
MsgBox "This computer appears to be USB 2 enabled."
End If
End If

Show Network Icon When Connected

---open Notepad > type & save the below lines with a filename xxx.vbs & run it----

On Error Resume Next

set ws = WScript.CreateObject("WScript.Shell")

start = "HKLM\SYSTEM\CurrentControlSet"

classGUID = ws.RegRead(start & "\Enum\Root\MS_NDISWANIP\0000\ClassGUID")
netID = ws.RegRead(start & "\Control\Class\" & classGUID & "\0000\NetCfgInstanceID")

ws.RegWrite start & "\Control\Network\" & classGUID & "\" & netID & "\Connection\ShowIcon", 1, "REG_DWORD"

MsgBox "Show icon in Notification Area when connected is set.", 4096,"Finished"

Restore safely remove hardware icon

---open Notepad > type & save the below lines with a filename xxx.vbs & run it----

set shell=createobject("wscript.shell")
shell.run "RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll"

Restore Access to Control Panel

---open Notepad > type & save the below lines with a filename xxx.vbs & run it----

'fixnocontrolpanel.vbs - Restores Control Panel after lockout with TweakUI or other utility
'© Doug Knox - 10/28/2001
'This code may be freely distributed/modified

'Downloaded from www.dougknox.com


Option Explicit
On Error Resume Next
'Declare variables
Dim WSHShell, MyBox, p1, t
Dim jobfunc
'Set the Windows Script Host Shell and assign values to variables
Set WSHShell = WScript.CreateObject("WScript.Shell")
p1 = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoControlPanel"
'Describe the funtion of the script for a dialog box
jobfunc = "Control Panel has now been restored." & vbCR
jobfunc = jobfunc & "You may need to log off/log on for the " & vbCR
jobfunc = jobfunc & "change to take effect."
'This section writes the correct values to the Registry
WSHShell.RegDelete p1
t = "Confirmation"
MyBox = MsgBox (jobfunc, 4096, t)

Reinstall / Repair IE and OE

---open Notepad > type & save the below lines with a filename xxx.vbs & run it----

'run_ie_reinstall.vbs - Runs the Internet Explorer Setup
'© Doug Knox - 4/10/2002
'Downloaded from www.dougknox.com

X = MsgBox("Do you want to reinstall Internet Explorer?", vbYesNo, "Prompt!")

Y = MsgBox("Do you want to reinstall Outlook Express?", vbYesNo, "Prompt!")

Set WshShell = WScript.CreateObject("WScript.Shell")

If X = 6 Then
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{89820200-ECBD-11cf-8B85-00AA005B4383}\IsInstalled", 0, "REG_DWORD"
End If

If Y = 6 Then
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{44BBA840-CC51-11CF-AAFA-00AA00B6015C}\IsInstalled", 0, "REG_DWORD"
End If

If X = 6 OR Y = 6 Then
WshShell.Run ("rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %windir%\Inf\ie.inf")
Else
MsgBox "You chose not to reinstall IE or OE. No changes were made." & vbCR & vbCR & "Copyright 2003 - Doug Knox",vbOkOnly, "User Cancelled"
End If

Enable / Disable Recent Documents History

---open Notepad > type & save the below lines with a filename xxx.vbs & run it----

'docshist.vbs - Disables/Enables Recent Docs History
'© Doug Knox - rev 12/17/99

Option Explicit

'Declare variables
Dim WSHShell, n, MyBox, p, p1, p2, t, mustboot, errnum, vers
Dim enab, disab, jobfunc, itemtype

Set WSHShell = WScript.CreateObject("WScript.Shell")
p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"
p = p & "NoRecentDocsHistory"
itemtype = "REG_DWORD"
mustboot = "Log off and back on, or restart your pc to" & vbCR & "effect the changes"
enab = "ENABLED"
disab = "DISABLED"
jobfunc = "Recent Docs History is now "

'This section tries to read the registry key value. If not present an
'error is generated. Normal error return should be 0 if value is
'present
t = "Confirmation"
Err.Clear
On Error Resume Next
n = WSHShell.RegRead (p)
On Error Goto 0
errnum = Err.Number

if errnum <> 0 then
'Create the registry key value for NoRecentDocsHistory with value 0
WSHShell.RegWrite p, 0, itemtype
End If

'If the key is present, or was created, it is toggled
'Confirmations can be disabled by commenting out
'the two MyBox lines below

If n = 0 Then
n = 1
WSHShell.RegWrite p, n, itemtype
Mybox = MsgBox(jobfunc & disab & vbCR & mustboot, 4096, t)
ElseIf n = 1 then
n = 0
WSHShell.RegWrite p, n, itemtype
Mybox = MsgBox(jobfunc & enab & vbCR & mustboot, 4096, t)
End If

Disable Media Player's Recent Files List

---open Notepad > type & save the below lines with a filename xxx.vbs & run it----

'mediaplayer_mru_off.vbs - Prevents additions to the Recent Files List
'© Doug Knox - revised 03/16/2002
'This code may be freely distributed/modified
'Downloaded from www.dougknox.com

Option Explicit
On Error Resume Next
Dim p1, p2, p3, WshShell, MyBox

p1 = "HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Preferences\AddToMRU"
p2 = 00
p3 = "HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Player\RecentFileList\"

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegWrite p1, p2, "REG_BINARY"
WshShell.RegDelete p3

Set WshShell = Nothing

MyBox = MsgBox("Media Player's Recent File list is Disabled", 4096, "Finished")

Disable / Enable Registry Editing tools in Windows

---open Notepad > type & save the below lines with a filename xxx.vbs & run it----

'Enable/Disable Registry Editing tools
'© Doug Knox - rev 12/06/99

Option Explicit

'Declare variables
Dim WSHShell, n, MyBox, p, t, mustboot, errnum, vers
Dim enab, disab, jobfunc, itemtype

Set WSHShell = WScript.CreateObject("WScript.Shell")
p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\"
p = p & "DisableRegistryTools"
itemtype = "REG_DWORD"
mustboot = "Log off and back on, or restart your pc to" & vbCR & "effect the changes"
enab = "ENABLED"
disab = "DISABLED"
jobfunc = "Registry Editing Tools are now "

'This section tries to read the registry key value. If not present an
'error is generated. Normal error return should be 0 if value is
'present
t = "Confirmation"
Err.Clear
On Error Resume Next
n = WSHShell.RegRead (p)
On Error Goto 0
errnum = Err.Number

if errnum <> 0 then
'Create the registry key value for DisableRegistryTools with value 0
WSHShell.RegWrite p, 0, itemtype
End If

'If the key is present, or was created, it is toggled
'Confirmations can be disabled by commenting out
'the two MyBox lines below

If n = 0 Then
n = 1
WSHShell.RegWrite p, n, itemtype
Mybox = MsgBox(jobfunc & disab & vbCR & mustboot, 4096, t)
ElseIf n = 1 then
n = 0
WSHShell.RegWrite p, n, itemtype
Mybox = MsgBox(jobfunc & enab & vbCR & mustboot, 4096, t)
End If

Disable / Enable Internet & Folder Options

---open Notepad > type & save the below lines with a filename xxx.vbs & run it----

'Downloaded from www.dougknox.com
'Fix Internet Options Restrictions
'© Doug Knox - rev 05/21/2003

Option Explicit

'Declare variables
Dim WSHShell, n, MyBox, p, p1, p2, itemtype
itemtype = "REG_DWORD"

Set WSHShell = WScript.CreateObject("WScript.Shell")

p = "HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoBrowserOptions"
p1 = "HKEY_USERS\.DEFAULT\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoBrowserOptions"
p2 = "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Internet Explorer\Restrictions\NoBrowserOptions"

'Create/modify the registry key value for NoBrowserOptions with value 0
WSHShell.RegWrite p, 0, itemtype
WSHShell.RegWrite p1, 0, itemtype
WSHShell.RegWrite p2, 0, itemtype

p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoFolderOptions"
p1 = "HKEY_USERS\.Default\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoFolderOptions"
p2 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoFolderOptions"

'Create/modify the registry key value for NoFolderOptions with value 0
WSHShell.RegWrite p, 0, itemtype
WSHShell.RegWrite p1, 0, itemtype
WSHShell.RegWrite p2, 0, itemtype

MsgBox "Done. You may need to log off/log on or reboot for the change to take effect.",4096,"Finished!"

Clears Search History in Windows XP

---open Notepad > type & save the below lines with a filename xxx.vbs & run it----

'xp_clear_search.vbs - Clears Search History in Windows XP
'© Doug Knox - revised 04/15/2002
'This code may be freely distributed/modified
'Downloaded from www.dougknox.com

Option Explicit
On Error Resume Next
Dim p1, p2, p3, WshShell, MyBox

p1 ="HKEY_CURRENT_USER\Software\Microsoft\Search Assistant\ACMru\5001\"
p2 = "HKEY_CURRENT_USER\Software\Microsoft\Search Assistant\ACMru\5603\"
p3 = "HKEY_CURRENT_USER\Software\Microsoft\Search Assistant\ACMru\5604\"

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegDelete p1
WshShell.RegDelete p2
WshShell.RegDelete p3

Set WshShell = Nothing

'Un-comment the next line to make the confirmation dialog appear
'MyBox = MsgBox("Search History has been cleared.", 4096, "Finished")

Change Owner & Organization details in computer

---open Notepad > type & save the below lines with a filename xxx.vbs & run it----

'ChgOwnOrg.vbs - Change Win9x Registered Owner/Organization.
'© Bill James - billjames.geo@yahoo.com - rev 29 Oct 1999.
'Modified for Windows XP

Option Explicit

Set ws = WScript.CreateObject("WScript.Shell")
Dim ws, t, p1, p2, n, g, cn, cg
Dim itemtype

p1 = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\"

n = ws.RegRead(p1 & "RegisteredOwner")
g = ws.RegRead(p1 & "RegisteredOrganization")
t = "Change Owner and Organization Utility"
cn = InputBox("Type new Owner and click OK", t, n)
If cn <> "" Then
ws.RegWrite p1 & "RegisteredOwner", cn
End If

cg = InputBox("Type new Organization and click OK.", t, g)
If cg <> "" Then
ws.RegWrite p1 & "RegisteredOrganization", cg
End If

adminwelcomescreen

---open Notepad > type & save below lines with a filename xxx.vbs & run it----

Dim WSHShell, n, MyBox, p, p1, t, cn, Caption, itemtype, errnum

Set WSHShell = WScript.CreateObject("WScript.Shell")
p = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList\Administrator"
itemtype = "REG_DWORD"
t= "Choose Accordingly"


On Error Resume Next

n = ws.RegRead(p)

errnum = Err.Number
If errnum <> 0 then

n = 0
End If

Caption = "1 = Show Administrator on Destop, 0 = Don't Show Administrator on Desktop"
On Error Goto 0

cn = InputBox(Caption, t, n)
If cn <> "" Then
WSHShell.RegWrite p, cn, itemtype
End If

If cn <>"" Then
MyBox = MsgBox("You must Log Off/Log On for the changes to take effect.", vbOKOnly,"Done")
End If

VisitKelly's Korner

Sub VisitKelly's Korner
If MsgBox("This script came from the Tweaks Section of Kelly's Korner" & vbCRLF & vbCRLF & "Would you like to visit Kelly's Web Site now?", vbQuestion + vbYesNo + vbDefaultButton, "Visit Kelly's Korner") =6 Then
wshshell.Run "http://www.kellys-korner-xp.com/xp_tweaks.htm"
End If
End Sub

Restore Default File Associations Easily

---open Notepad > type & save below lines with a filename xxx.bat & run it----

REM Restore Default File Associations for Windows XP.
REM Copyright 2003 - Doug Knox
REM This BAT file restores the Default associations that XP ships with
REM It does not restore associations created by 3rd party applications.

Echo Restoring Default File Associations

assoc.323=h323file
assoc.386=vxdfile
assoc.aca=Agent.Character.2
assoc.acf=Agent.Character.2
assoc.acs=Agent.Character2.2
assoc.acw=acwfile
assoc.ai=
assoc.aif=AIFFFile
assoc.aifc=AIFFFile
assoc.aiff=AIFFFile
assoc.ani=anifile
assoc.aps=
assoc.asa=aspfile
assoc.ascx=
assoc.asf=ASFFile
assoc.asm=
assoc.asmx=
assoc.asp=aspfile
assoc.aspx=
assoc.asx=ASXFile
assoc.au=AUFile
assoc.AudioCD=AudioCD
assoc.avi=avifile
assoc.bat=batfile
assoc.bfc=Briefcase
assoc.bin=
assoc.bkf=msbackupfile
assoc.blg=PerfFile
assoc.bmp=Paint.Picture
assoc.bsc=
assoc.c=
assoc.cab=CLSID\{0CD7A5C0-9F37-11CE-AE65-08002B2E1262}
assoc.cat=CATFile
assoc.cda=CDAFile
assoc.cdf=ChannelFile
assoc.cdx=aspfile
assoc.cer=CERFile
assoc.cgm=
assoc.chk=chkfile
assoc.chm=chm.file
assoc.clp=clpfile
assoc.cmd=cmdfile
assoc.cnf=ConferenceLink
assoc.com=comfile
assoc.cpl=cplfile
assoc.cpp=
assoc.crl=CRLFile
assoc.crt=CERFile
assoc.css=CSSfile
assoc.csv=
assoc.CTT=MessengerContactList
assoc.cur=curfile
assoc.cxx=
assoc.dat=
assoc.db=dbfile
assoc.dbg=
assoc.dct=
assoc.def=
assoc.der=CERFile
assoc.DeskLink=CLSID\{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}
assoc.dib=Paint.Picture
assoc.dic=
assoc.diz=
assoc.dll=dllfile
assoc.dl_=
assoc.doc=WordPad.Document.1
assoc.dos=
assoc.dot=
assoc.drv=drvfile
assoc.dsn=MSDASQL
assoc.dun=dunfile
assoc.DVD=DVD
assoc.emf=emffile
assoc.eml=Microsoft Internet Mail Message
assoc.eps=
assoc.exe=exefile
assoc.exp=
assoc.ex_=
assoc.eyb=
assoc.fif=
assoc.fnd=fndfile
assoc.fnt=
assoc.Folder=Folder
assoc.fon=fonfile
assoc.ghi=
assoc.gif=giffile
assoc.grp=MSProgramGroup
assoc.gz=
assoc.h=
assoc.hhc=
assoc.hlp=hlpfile
assoc.hpp=
assoc.hqx=
assoc.ht=htfile
assoc.hta=htafile
assoc.htc=
assoc.htm=htmlfile
assoc.html=htmlfile
assoc.htt=HTTfile
assoc.htw=
assoc.htx=
assoc.hxx=
assoc.icc=icmfile
assoc.icm=icmfile
assoc.ico=icofile
assoc.idb=
assoc.idl=
assoc.idq=
assoc.iii=iiifile
assoc.ilk=
assoc.imc=
assoc.inc=
assoc.inf=inffile
assoc.ini=inifile
assoc.ins=x-internet-signup
assoc.inv=
assoc.inx=
assoc.in_=
assoc.isp=x-internet-signup
assoc.its=ITS File
assoc.IVF=IVFFile
assoc.java=
assoc.jbf=
assoc.jfif=pjpegfile
assoc.job=JobObject
assoc.jod=Microsoft.Jet.OLEDB.4.0
assoc.jpe=jpegfile
assoc.jpeg=jpegfile
assoc.jpg=jpegfile
assoc.JS=JSFile
assoc.JSE=JSEFile
assoc.latex=
assoc.lib=
assoc.lnk=lnkfile
assoc.local=
assoc.log=txtfile
assoc.lwv=LWVFile
assoc.m14=
assoc.m1v=mpegfile
assoc.m3u=m3ufile
assoc.man=
assoc.manifest=
assoc.MAPIMail=CLSID\{9E56BE60-C50F-11CF-9A2C-00A0C90A90CE}
assoc.mdb=
assoc.mht=mhtmlfile
assoc.mhtml=mhtmlfile
assoc.mid=midfile
assoc.midi=midfile
assoc.mmf=
assoc.mmm=MPlayer
assoc.mov=
assoc.movie=
assoc.mp2=mpegfile
assoc.mp2v=mpegfile
assoc.mp3=mp3file
assoc.mpa=mpegfile
assoc.mpe=mpegfile
assoc.mpeg=mpegfile
assoc.mpg=mpegfile
assoc.mpv2=mpegfile
assoc.msc=MSCFile
assoc.msg=
assoc.msi=Msi.Package
assoc.msp=Msi.Patch
assoc.MsRcIncident=MsRcIncident
assoc.msstyles=msstylesfile
assoc.MSWMM=Windows.Movie.Maker
assoc.mv=
assoc.mydocs=CLSID\{ECF03A32-103D-11d2-854D-006008059367}
assoc.ncb=
assoc.nfo=MSInfo.Document
assoc.nls=
assoc.NMW=T126_Whiteboard
assoc.nsc=
assoc.nvr=
assoc.nws=Microsoft Internet News Message
assoc.obj=
assoc.ocx=ocxfile
assoc.oc_=
assoc.odc=
assoc.otf=otffile
assoc.p10=P10File
assoc.p12=PFXFile
assoc.p7b=SPCFile
assoc.p7c=certificate_wab_auto_file
assoc.p7m=P7MFile
assoc.p7r=SPCFile
assoc.p7s=P7SFile
assoc.pbk=pbkfile
assoc.pch=
assoc.pdb=
assoc.pds=
assoc.pfm=pfmfile
assoc.pfx=PFXFile
assoc.php3=
assoc.pic=
assoc.pif=piffile
assoc.pko=PKOFile
assoc.pl=
assoc.plg=
assoc.pma=PerfFile
assoc.pmc=PerfFile
assoc.pml=PerfFile
assoc.pmr=PerfFile
assoc.pmw=PerfFile
assoc.pnf=pnffile
assoc.png=pngfile
assoc.pot=
assoc.pps=
assoc.ppt=
assoc.prf=prffile
assoc.ps=
assoc.psd=
assoc.psw=PSWFile
assoc.qds=SavedDsQuery
assoc.rat=ratfile
assoc.rc=
assoc.RDP=RDP.File
assoc.reg=regfile
assoc.res=
assoc.rle=
assoc.rmi=midfile
assoc.rnk=rnkfile
assoc.rpc=
assoc.rsp=
assoc.rtf=rtffile
assoc.sam=
assoc.sbr=
assoc.sc2=
assoc.scf=SHCmdFile
assoc.scp=txtfile
assoc.scr=scrfile
assoc.sct=scriptletfile
assoc.sdb=appfixfile
assoc.sed=
assoc.shb=DocShortcut
assoc.shs=ShellScrap
assoc.shtml=
assoc.shw=
assoc.sit=
assoc.snd=AUFile
assoc.spc=SPCFile
assoc.spl=ShockwaveFlash.ShockwaveFlash
assoc.sql=
assoc.sr_=
assoc.sst=CertificateStoreFile
assoc.stl=STLFile
assoc.stm=
assoc.swf=ShockwaveFlash.ShockwaveFlash
assoc.sym=
assoc.sys=sysfile
assoc.sy_=
assoc.tar=
assoc.text=
assoc.tgz=
assoc.theme=themefile
assoc.tif=TIFImage.Document
assoc.tiff=TIFImage.Document
assoc.tlb=
assoc.tsp=
assoc.tsv=
assoc.ttc=ttcfile
assoc.ttf=ttffile
assoc.txt=txtfile
assoc.UDL=MSDASC
assoc.uls=ulsfile
assoc.URL=InternetShortcut
assoc.VBE=VBEFile
assoc.vbs=VBSFile
assoc.vbx=
assoc.vcf=vcard_wab_auto_file
assoc.vxd=vxdfile
assoc.wab=wab_auto_file
assoc.wav=soundrec
assoc.wax=WAXFile
assoc.wb2=
assoc.webpnp=webpnpFile
assoc.WHT=Whiteboard
assoc.wk4=
assoc.wll=
assoc.wlt=
assoc.wm=ASFFile
assoc.wma=WMAFile
assoc.wmd=WMDFile
assoc.wmf=wmffile
assoc.wmp=WMPFile
assoc.wms=WMSFile
assoc.wmv=WMVFile
assoc.wmx=ASXFile
assoc.wmz=WMZFile
assoc.wpd=
assoc.wpg=
assoc.wri=wrifile
assoc.wsc=scriptletfile
assoc.WSF=WSFFile
assoc.WSH=WSHFile
assoc.wsz=
assoc.wtx=txtfile
assoc.wvx=WVXFile
assoc.x=
assoc.xbm=
assoc.xix=
assoc.xlb=
assoc.xlc=
assoc.xls=
assoc.xlt=
assoc.xml=xmlfile
assoc.xsl=xslfile
assoc.z=
assoc.z96=
assoc.zap=zapfile
assoc.ZFSendToTarget=CLSID\{888DCA60-FC0A-11CF-8F0F-00C04FD7D062}
assoc.zip=CompressedFolder

Echo Default File Associations Restored