Wednesday, 14 November 2012

Set Environment Variables in Win XP

Hi Friends!

I apologize again for not continuing with BSOD chapter. I know, some of you would be feeling that this punk is overflowing with ideas & not completing the earlier ones. But, as an adage goes, 'Don't blame the person, blame the situation.' Well I guess, it all fits in here well.

In my quest to help people, when I encounter some one stuck up with something, I feel( and I hope you'l agree) that his priority increase manifold!

So in this post, I am going to talk on how to set up environment privileges in XP machine(same steps follows for Win7).

So let's get started.

Topic: Set environment variable in Win XP.

Let us first understand what Environment variables mean:

Many Operating Systems use environment variables to pass configuration information to applications. They are used as key/value pair where both the key and the value are strings.

Step 1: Right click My Computer -> Properties

      
Step 2: Click on Advanced tab. There you will find Environment Variables button at the bottom of the page. 

                                             

Step 3: You will see a screen as the one below.

                             
Now to create a new environment variable, click on New(enclosed in rectangle)

Step 4: Now give the key/ value pair you like to make as environment variables.

           
The Path environment variable

The path variable to a file basically represents its location on the file system. It tell the OS, where to find that file. Typically, a group of directories which are repeatedly used, are found. To see, what the path variables contains, go to cmd -> 'echo %PATH%' (don't worry about the case, they are not case-sensitive).

         

As you can see, there are multiple values, each separated by ';'.

In the same way, you can double click on the variable on the variable in step 3.

So, I guess my java friends won't find issues in this section of the program.

Happy Coding!! ^o^

Sunday, 11 November 2012

Taskkill Command

Hi Friends!

I apologize for not continuing with my BSOD article. The reason is quite hilarious: Last friday, one of my mates said that he feels like 'Neo'( from the Matrix series), when he sees himself working in comand prompt, like a scientist!!

He added, that, how easy it is to open programs from Run(Windows+R), if only, there could be such a short cut to kill a process using Run utility.

We all had a laugh as killing a process from task manager is the easiest method in the business, but, for people like him, there is a command - taskkill, which helps you to close any existing running program.

So lets get started.

taskkill(as the name suggest) kills one or more processes. The only hurdle is that it processes can be killed using process ID or image name(both could be known from Task Manager-> Processes tab)

The PID column is not visible by default, you need to select it from the list of columns to be shown in task manager. To make it visible, Click on View->Select Columns...


You will get another pop up, check all columns which you wish to see.

& PID is available to you.

Now, as we are equipped with both the parameters(though we need to know only one between them), we are ready to execute this command.

The syntax of the command is

taskkill [/s Computer] [/u Domain\User [/p Password]]] [/fi FilterName] [/pid ProcessID]|[/im ImageName] [/f][/t]

Let us now dissect the command one by one:

1. /s Computer specifies the name or IP address of the remote computer. Default: Local computer

2. /u Domain \User specifies account permissions of the specific user

3. /p Password specifies password for the account mentioned in 2.

4. /fi Filter Name: This is the protagonist of the story. It specifies the filters you can while executing your command. Using this you can apply filter on any column listed in task manager.

Eg:  taskkill /f /fi "USERNAME eq NT AUTHORITY\SYSTEM" /im devenv.exe

       taskkill /f /fi "PID ge 2000" /im *

 The keywords 'eq' -> 'equal to' , 'ge' -> 'greater than' are commonly used operators.

5. /pid ProcessID specifies the process id

6. /im ImageName: specifies the image name. Eg: notepad.exe, firefox.exe, iexplore.exe, devenv.exe, appleMobileServiceDevice.exe...

7. /f specifies that the process(es) should be terminated forcefully. Please note that all remote processes are killed forcefully; so this element is not much of use, when used for remote machine

8. /t: You might have seen when you right click on a process in task manager, you get two(among other options) options as Kill Process, below that Kill Process Tree. The -t element is for the second case. It species that all child processes should be killed along with the parent process.

One more example

    taskkill /f /im notepad.exe

Don't worry about remembering the image name for processes, with some practise, you will remember commonly used processes image name.

I hope now that my friend( and many other), could completely visualize themselves as Neo!

Rest is Next. Till then AdiĆ³s!



  

Saturday, 10 November 2012

Blue Screen Of Death: Part-I CAUSE

Hi Friends!

I am sorry I kept you wating for my post for such a long time. Well, I just moved to IT city of India (it is not its' official tag, but people call it though) & was busy adapting to the new environment.

Lets come to the topic of todays learning: Blue Screen Of Death. Lets get started.

All Windows users would have faced this screen at least once in their life time. Correct??

To begin with and to write on this topic, I made an extensive search on the net about- what this problem is; where/how could you log this error & possible solutions(including a link to Microsoft KBHotfix).

As this is the first part of the series, let's try to understand what causes this error?

Windows(even linux, FYI) OS runs in two modes:
slave/user/unprivileged mode and the master/kernel/privileged.

Now, the inquisitive human mind asks, "what are they? Right?".
To put it in simple terms to answer this question, let us understand it as to perform a specialised task, the user-mode(code) makes a system call into supervisor mode and here the trusted code of the OS will perform the necessary task and return the result to the user space.

Stop errors(general term for BSOD) are invariably caused by kernel portal components exceptions for eg. hardware, third-party drivers or anti-virus services.

The screen turns blue because there is some exceptions occured in the kernel (either through device driver error or the service error), and when Windows detects some error in the Kernel, it will try to abort the processes, lest something more dangerous occur. Hence we get a blue screen and typically it is followed by a system restart.

Brien had presented the anatomy of this error. You could read it link here.

Hope this gives a clear idea of what causes the error, the next post will be on Saving a memory dump and the solution to this nemesis.

Catch you in the second part of this blog.

Till then,

Have a safe computing!