Saturday, April 11, 2009

Kill Any Process from Command Prompt

I'm sure you are familiar with the traditional way to kill or end a process in Windows using Task Manager. This method is effective but not nearly as fun as killing a process in Command Prompt. Additionally, killing processes in Command Prompt provides much more control and the ability to end multiple processes at once.

All of this is possible with the TaskKill command. First, let's cover the basics. You can kill a process by the process ID (PID) or by image name (EXE filename).

Open up an Administrative level Command Prompt and run tasklist to see all of the running processes:

C:\>tasklist

Image Name PID Session Name Mem Usage
========================= ======== ================ ============
firefox.exe 26356 Console 139,352 K
regedit.exe 24244 Console 9,768 K
cmd.exe 18664 Console 2,380 K
conhost.exe 2528 Console 7,852 K
notepad.exe 17364 Console 7,892 K
notepad.exe 24696 Console 22,028 K
notepad.exe 25304 Console 5,852 K
explorer.exe 2864 Console 72,232 K

In the example above you can see the image name and the PID for each process. If you want to kill the firefox process run:

C:\>Taskkill /IM firefox.exe /F

or

C:\>Taskkill /PID 26356 /F

The /f flag is kills the process forcefully. Failure to use the /F flag will result in nothing happening in some cases. One example is whenever I want to kill the explorer.exe process I have to use the /F flag or else the process just does not terminate.

If you have multiple instances of an image open such as multiple firefox.exe processes, running the taskkill /IM firefox.exe command will kill all instances. When you specify the PID only the specific instane of firefox will be terminated.

The real power of taskkill are the filtering options that allow you to use the following variables and operators.

Variables:

  • STATUS
  • IMAGENAME
  • PID
  • SESSION
  • CPUTIME
  • MEMUSAGE
  • USERNAME
  • MODULES
  • SERVICES
  • WINDOWTITLE

Operators:

  • eq (equals)
  • ne (not equal)
  • gt (greater than)
  • lt (less than)
  • ge (greater than or equal)
  • le (less than or equal)

"*" is the wildcard.

You can use the variables and operators with the /FI filtering flag. For example, let's say you want to end all processes that have a window title that starts with "Internet":

C:\>taskkill /FI "WINDOWTITLE eq Internet*" /F

How about killing all processes running under the Steve account:

C:\>taskkill /FI "USERNAME eq Steve" /F

It is also possible to kill a process running on a remote computer with taskkill. Just run the following to kill notepad.exe on a remote computer called SteveDesktop:

C:\>taskkill /S SteveDesktop /U RemoteAccountName /P RemoteAccountPassword /IM notepad.exe /F

To learn more about taskkill run it with the /? command just like any other Windows command.


Friday, April 10, 2009

Free Demonoid Invitation/Account

I am giving out free Demonoid Account's for a limited period of time.
This is solely to increase the popularity as well as visitors to my site.

I have created many accounts for Demonoid during their open registration as well as
have many invitations.

To get your account all u have to do is leave a comment on why do you want the account,
how can I improve my blog or provide with some interesting articles/tricks to publish here.

The best comment of the day will receive their Account Username & Password in their email.

Alternatively ,You can receive your account instantly by Transferring $2 to my PayPal Account.
You can contact me through my mail : i.ricr@yahoo.com for further details.

Convert From Fat32 to NTFS

To convert your drive or partition from fat32 to ntfs, type the following at Start - Run (assuming it's drive c:):

CONVERT C: /FS:NTFS

If you are asked if you want to dismount the drive, you must answer yes.

Alternatively, you can use a utility such as Partition Magic

Thursday, April 9, 2009

Repair Install of XP

  • Make sure the BIOS is set to boot from the CD (put the CD above the HD in the boot order)
  • Insert the XP CD and boot to it
  • When you see " To setup Windows XP now, press ENTER", go ahead and press ENTER
  • You will now see an option to repair Windows by pressing "R". Do notselect this option - it will only take you to the Recovery Console which is not what we want to do. Instead, choose to continue the installation
  • When you see the license agreement, press F8 to agree
  • On the next screen make sure your current XP installation is selected and then press "R" to repair XP
  • At this point XP will begin to install on top of itself, replacing damaged, missing or altered system files. Follow the instructions on the remaining screens to complete the Repair Install. It will look very much like a normal (new) OS installation.

If all goes well your repaired XP installation will remain iintact, keeping your personalized settings and installed programs as they originally were. Remember, choose the second repair option, not the first.

Wednesday, April 8, 2009

Work With XP's Registry

Opening the registry editor

This is step number one, just opening the editor to view the registry.

This is easy, just click on the start button and then on run. Once run is open, type in regedit and click OK.

Navigating the registry

Once you have regedit open, it is fairly easy to get where you want to.

Now you see the "folders" HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, and HKEY_CURRENT_CONFIG

First lets get some basic terminology down. These five main "folders" are calles hives, and their subfolders are called keys.

Click on the + next to HKEY_CURRENT_USER to expand the hive.

Now if you wanted to open HKEY_CURRENT_USER\Software\Microsoft, click the + next to Software, then the + next to Microsoft.

This is how you can get to any place within the registry.

Exporting registry keys

This should be done to any and all registry keys before changing them.

It will give you an easy way of changing back any changes that you make editing the registry.

Right click the key that you want to export, and select Export.

Then give it a name so you remember what it is. I use the name of the key as an example.

Importing registry files

Now that you have exported keys to change back your changes, you need to know how to import them into the registry.

Usually a double-click on a registry file will merge it for you unless you have changed the default action, then you have to right-click the file and select Merge.

Changing existing values

You now know how to navigate to different keys in the registry and how to back up these keys before you make changes to them.

Logically next you need to know how to make these changes.

There are three main types of registry values that you will deal with: STRINGS, DWORDS, and BINARY values.
There are others, but these are 99% of what you will deal with doing normal editing.

To change an existing STRING value, just double click it and enter in the new value data.

To change an existing DWORD value you have two options, hexadecimal and decimal. Be sure you know what type the value should be, 200 hexadecimal is 256 decimal, c8 is hexadecimal for 200 decimal, for example.

To change binary values it is a little more complicated because they are written in hex.

The applicable values are entered in 2's and have the format 00 01 02 - 0F - FF and each have a different value associated with them.

Having to change a binary value from something other than 01 to 00 or 00 to 01 is pretty rare.

Adding new values

Adding values is very similar to changing them with the exception that you have to name the value.

Right click in the left-hand-side of the registry editor and select New > String (or whatever value type you want to add) and then name it what you need.

Then you change its value by doing the same method as if it was an existing value.

Adding new keys

Along with adding values, this is most helpful if you are trying to add group policy values through the registry.
Most of the keys that are needed for them are not there by default.

So, you need to add a key under HKEY_CURRENT_USER\Software\Policies\Microsoft, how?

Easily, just right-click on HKEY_CURRENT_USER\Software\Policies\Microsoft in the folder tree, and then New > Key

Now you need to change the name of the key to the desired name.

Deleting keys and values

The first thing that must be realized when deleting keys or values is that there is no 'Recycle Bin' for the registry, once its gone its gone.

To delete keys or values, just right-click them and select delete. Also keep in mind that deleting a key also deletes all subkeys of that key.

Writing registry files

Now you can automate the manual entry and deletion of registry values and keys with .reg files. Use notepad or wordpad to write registry files, you just save them with a .reg extension.

The first line in the registry file for XP or 2000 has to be:

Windows Registry Editor Version 5.00


NOTE: For windows 98, ME, NT 4.0, [also works with XP and 2k] replace with:

REGEDIT4

Put a line in between Windows Registry Editor 5.00 and the next entry.

Now you have to declare the key that you want to change values in by writing it in brackets.

This will also create the key if the one declared doesn't exist:

[HKEY_CURRENT_USER\Key\Subkey]

Now the next line will either create the string "String 1" equal to "Value 1" if "String 1" doesn't exist,
or change the value of the string "String 1" to "Value 1" if it does:

"String 1"="Value 1"


The (default) value is a string and you use the "at" symbol for this.

@="Default 1"

To change or create dword values, you must know the value in hexadecimal, for that is how they are written.

The next line will create the dword "Dword 1" equal to a decimal 20, by setting it equal to dword:00000014,
or if "Dword 1" already exists, it will change it's value to a decimal 20.

Just remember dword:00000010 is actually decimal 16, dword:0000000a is decimal 10

"Dword 1"=dword:00000014

Now binary values. This line will create or change a binary value "Binary 1" equal to 01 AA 05 55.

"Binary 1"=hex:01,AA,05,55

So this is the reg file to add a string, default, dword, and binary value to HKEY_CURRENT_USER\Key\Subkey:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Key\Subkey]
"String 1"="Value 1"
@="Default 1"
"Dword 1"=dword:00000014
"Binary 1"=hex:01,AA,05,55


Now how to delete values or keys with regfiles.

If you want to delete a key just put a minus sign in front of it in the file:

[red[-HKEY_CURRENT_USER\Key\Subkey]

If you want to delete a value, it doesn't matter what kind, set the value equal to a minus.

"String 1"=-

@=-

"Dword 1"=-

"Binary 1"=-


So if you wanted to add a dword "Dword 1" that equals 1,
and delete the value "String 1" in HKEY_CURRENT_USER\Key\Subkey1 and delete the HKEY_CURRENT_USER\Key\Subkey2, the file would look like:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Key\Subkey1]
"Dword 1"=dword:00000001
"String 1"=-

[-HKEY_CURRENT_USER\Key\Subkey2]


The final thing to learn is how to comment the files,
add a semiclon in front of any line and it will be ignored:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Key\Subkey1]
;This changes the dword to equal 1
"Dword 1"=dword:00000001
;This deletes the string value
"String 1"=-

;This deletes the key Subkey2
[-HKEY_CURRENT_USER\Key\Subkey2]


This should help you navigate and hack through the registry with atleast a partial map to guide you.

Tuesday, April 7, 2009

Remove Control Panel Items

This tweak is useful for uncluttering your Control Panel and removing unused functions:

  1. Open Regedit and go to:
    [HKEY_CURRENT_USER\Control Panel\]
  2. Add a key named Don't Load
  3. Next add String values within the "don't load" Key. You will use one String value for each control panel applet you want removed. For example, if I want to remove the System applet I will make a string value with the name sysdm.cpl and no value set and the System applet will no longer be available under the Control Panel.
  4. To restore a full control Panel to default just delete the "don't load" key.

    Here are the Windows XP Pro Control Panel applets:
    System Properties = sysdm.cpl
    Network Connections = ncpa.cpl
    ODBC Administrator = odbccp32.cpl
    Display Properties = desk.cpl
    Add or remove programs = appwiz.cpl
    Internet Properties = Inetcpl.cpl
    Game Controllers = joy.cpl
    Phone and modem Options = telephon.cpl
    Time and Date Properties = timedate.cpl
    Region and Language Options = intl.cpl
    Power Options = powercfg.cpl
    Mouse Properties = main.cpl
    Accessibility Options = access.cpl
    Add Hardware Wizard = hdwwiz.cpl
    Sound and Audio Devices = mmsys.cpl
    User Accounts = nusrmgr.cpl
    Speech Properties = sapi.cpl

Monday, April 6, 2009

Change Drive Letter in XP

If you want to change your hard drives letter or your cd-rom drive letter, this is the tip you want.


1. Click the start button

2. Go into Administrative tools (either in the start button or in "All Programs"

3. From Administrative Tools, go into "Computer Management"

4. In "Computer Management", click on "Disk Management" under "Storage" from the left menu

5. You should see a window from the lower right hand corner open (it shows all the hard disk drives and cd-rom drives)

6. To change...

...hard drive, click on the hard disk with a blue horizonal bar, the box should be shaded; next right click that box that you desire to change the letter then click on "Change Letter Drive and Path"

...cd-rom drive, click on the box that you desire the drive letter; next right click that box that you desire to change the letter then click on "Change Letter Drive and Path"

7. click the "change..." button

8. from the "assign the following drive letter", select the letter you want to assign to the hard drive or the cd-rom drive

9. click ok

10. click ok

11. (optional) redo the whole step to reassign other hard drives or cd-rom drives


There! You have succeeded in changing the hard drive or cd-rom drive letter. Enjoy!

Notes: You can not change the drive letter of your boot or system drive this way. You can not assign drive letters that are already in use. Assign temporary letters as a workaround.

Sunday, April 5, 2009

Make XP use Fat32 Partitions of size larger than 32GB

I have found a way to trick WinXP into using Partitions bigger then 32GB. I have been using a 60GB Fat32 partition on WinXP for over 4 months now and I haven't had a single problem. This is how you do it.

1 get a Win98 boot disk
2 boot from boot disk and run Fdisk
3 partition the drive to what size you want up to 120GB
4 reboot the computer off of the Win98 boot disk
5 format the drive
6 boot the computer off of the WinXP CD
7 proceed to install the WinXP.
8 When WinXP ask you what partition to install to choose the disk you just formated it will give you an several option dealing with NTFS don't pay them any mind and choose the last option which is to install WinXP to current drive without making any changes. WinXp will proceed to install normally and you will have WinXP installed to a fully functional FAT32 Partition greater then 32GB. WinXP can use larger then 32GB partitions M$ intentionally limited the Fdisk portion WinXP to push people to the Realm of NTFS.