Wednesday, July 28, 2010

How to change the administrator password of Windows while repairing the OS

You can easily change or wipe out your Administrator password for free during a Windows XP Repair. Here’s how with a step-by-step description of the initial Repair process included for newbie’s.

1. Place your Windows XP CD in your cd-rom and start your computer (it’s assumed here that your XP CD is bootable – as it should be - and that you have your bios set to boot from CD)

2. Keep your eye on the screen messages for booting to your cd typically; it will be “Press any key to boot from cd”

3. Once you get in, the first screen will indicate that Setup is inspecting your system and loading files.

4. When you get to the
Welcome to Setup screen, press ENTER to Setup Windows now

5. The Licensing Agreement comes next - Press F8 to accept it.

6. The next screen is the Setup screen which gives you the option to do a Repair.

It should read something like “If one of the following Windows XP installations is damaged, Setup can try to repair it”

Use the up and down arrow keys to select your XP installation (if you only have one, it should already be selected) and press R to begin the Repair process.

7. Let the Repair run. Setup will now check your disks and then start copying files which can take several minutes.

8. Shortly after the Copying Files stage, you will be required to reboot. (this will happen automatically – you will see a progress bar stating “Your computer will reboot in 15 seconds”

9. During the reboot, do not make the mistake of “pressing any key” to boot from the CD again! Setup will resume automatically with the standard billboard screens and you will notice Installing Windows is highlighted.

10. Keep your eye on the lower left hand side of the screen and when you see the Installing Devices progress bar, press SHIFT + F10. This is the security hole! A command console will now open up giving you the potential for wide access to your system.

11. At the prompt, type NUSRMGR.CPL and press Enter. Voila! You have just gained graphical access to your User Accounts in the Control Panel.

12. Now simply pick the account you need to change and remove or change your password as you prefer. If you want to log on without having to enter your new password, you can type control userpasswords2 at the prompt and choose to log on without being asked for password. After you’ve made your changes close the windows, exit the command box and continue on with the Repair (have your Product key handy).

13. Once the Repair is done, you will be able to log on with your new password (or without a password if you chose not to use one or if you chose not to be asked for a password). Your programs and personalized settings should remain intact.

I tested the above on Windows XP Pro with and without SP1 and also used this method in a real situation where someone could not remember their password and it worked like a charm to fix the problem. This security hole allows access to more than just user accounts. You can also access the Registry and Policy Editor, for example. And its gui access with mouse control. Of course, a Product Key will be needed to continue with the Repair after making the changes, but for anyone intent on gaining access to your system, this would be no problem.

And in case you are wondering, NO, you cannot cancel install after making the changes and expect to logon with your new password.

Cancelling will just result in Setup resuming at bootup and your changes will be lost.

Ok, now that your logon problem is fixed, you should make a point to prevent it from ever happening again by creating a Password Reset Disk. This is a floppy disk you can use in the event you ever forget your log on password. It allows you to set a new password.

Here's how to create one if your computer is NOT on a domain:

Go to the Control Panel and open up User Accounts.

Choose your account (under Pick An Account to Change) and under Related Tasks, click "Prevent a forgotten password".

This will initiate a wizard.

Click Next and then insert a blank formatted cd in your cd-rom.

Click Next and enter your logon password in the password box.

Click Next to begin the creation of your Password disk.

Once completed, label and save the disk to a safe place

How to Log on to your PC Using Your Password Reset Disk

Start your computer and at the logon screen, click your user name and leave the password box blank or just type in anything. This will bring up a Logon Failure box and you will then see the option to use your Password Reset disk to create a new password. Click it which will initiate the Password Reset wizard. Insert your password reset disk into your floppy drive and follow the wizard which will let you choose a new password to use for your account.

Note: If your computer is part of a domain, the procedure for creating a password disk is different.

See here for step by step instructions: http://support.microsoft.com/default.aspx?scid=KB;en-us;306214&

How to enable Remote Desktop remotely

In a case you want to remote access a Windows XP professional workstation and the computer Remote Desktop is not enabled, or no one over there to help you to enable it, you may have an option to enable Remote Desktop remotely by using regedit.

To enabling Remote Desktop using regedit, follow these steps:

Run REGEDIT from Start>Run

Click on File, then select Connect Network Registry

Type the remote computer IP or host name in the Enter the object name to select and the click OK.

If you don't have permission to access the remote computer, the logon screen will show up. Type the username and password for the remote computer. Then click OK.

Now, the remote computer is listed in the Registry Editor.

Browse to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TerminalServer, in the right panel.

Select fDenyTSConnection (REG_DWORD).

Change the value data from 1 (Remote Desktop disabled) to 0 (Remote Desktop enabled).

7. Close the regeidt.

Print to a USB Printer from DOS in Windows XP


In order to print from DOS in an offline environment like the stores, you will need to do a couple of things.

1) Install the Microsoft Loopback Adapter

a) In Control Panel, double click on Add Hardware.

b) Click Next

c) When the scan finishes, select "Yes, I have already connected the hardware"

d) Click Next

e) Scroll to the bottom of the list and select "Add a new hardware device"

f) Select "Install the hardware that I manually select from a list (Advanced)"

g) Click Next

h) Select "Network Adapters"

i) Click Next

j) Select "Microsoft" under the Manufacturer list.

k) Select "Microsoft Loopback Adapter" in the Network Adapter list.

l) Click Next

m) Click Next

n) Click Finish

2) Configure the Adapter

a) The loopback adapter is a virtual network adapter and can be configured the same as a
regular network card.
b) Set the adapter to have a static IP address such as 192.168.1.1/ 255.255.255.0

3) Share the printer.

a) I recommend you use a share name that you will remember. I used “Printer” in the new
machines that are already deployed.

4) Capture the printer port.

a) NET USE LPT1: \\[Computer Name]\Printer /PERSISTENT:YES

Hidden file problem when infected by virus

There are 2 methods by which you can make the hidden files available in your PC. They are:

First Method

Open Regedit.exe and go to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\NOHIDDEN.
There should be two registry entries there:

- CheckedValue : Type: DWORD Value: 2
- DefaultValue : Type: DWORD Value: 2

(Correct them if necessary.)

Now open the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL

and make the following changes:

- CheckedValue : Type: DWORD Value: 1
- DefaultValue : Type: DWORD Value: 2


Second Method
  1. Go to the start button and select Run .
  2. Type cmd in the pop up box and come to the dos prompt .
  3. To see the hidden files type command:- dir/ah and press enter.
  4. To unhide the file type:- attrib filename.extension -h -s and press enter .
OR

attrib * -h -s and press enter .
attrib foldername -h -s

Believe me these two methods will help u a lot without formatting ur pc

Shutdown or Restart a remote computer in your network

There is an easy GUI available from the "Run" command in the Start menu. Click on "Run" and then type "shutdown -i."
You can then browse for the PC you want to reboot, shut down or logoff.
If you'd like, you can inform the user and set a buffer time to allow the user to save work.
You can force PCs to reboot by using the command prompt version.
For example: "shutdown -r -t xxx -f -m \\myworkstation"
Where:
The -r" stands for reboot. You can replace it with "/s" for shutdown or "/l" to log the user off.
The "-t xxx" is the time allowed before rebooting --you change the xxx to any digit in seconds.
The "-f" is force -- you can choose to use or drop this.
The "-m \\myworkstation" specifies the PC in question. You can replace "myworkstation" with other PC names or IP addresses.
You can also create a text file with the shut down commands for all the company workstations. Change the extension to .bat and schedule the program to run every evening at 2am, to ensure all PCs are regularly rebooted.

Java Code to shutdown a computer

class shutdown
{
public static void main(String arg[])
{
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec("shutdown -s -t 0");
System.exit(0);
}
}


-s is the shutdown command
-t is the time out for shutdown

Tuesday, July 27, 2010

How to solve " One or more of the characters you typed in this field are invalid. Try typing different characters. " error in Windows XP

When you try to change the short or long date style settings in the Regional Settings tool in Control Panel, you may receive the following error message:

" One or more of the characters you typed in this field are invalid. Try typing different characters."

Solution :

To resolve this issue, add the following registry key and its associated string values, and then restart your computer:
HKEY_CURRENT_USER\Control Panel\International
iMeasure "1"
iNegCurr "0"
Locale "00000409"
sShortDate "MM/dd/yyyy"
sLongDate "MMMM dd,yyyy"

OR

Export the same registry key from any of the working machine and import it in to the PC which is having problem. Make sure you are importing it in to the correct registry node.