As of Microsoft Windows Vista/7/2008 Server, Windows operating systems have had extra security put in place to prevent general user applications from making system changes to the computer. This helps prevent malware from causing havoc on a PC.
Sometimes you do actually want to run a application that will make system changes, and to do this, you will need to run them “as administrator”.
The following will show you how to run the command prompt “as administrator”.
Click the Start button.
The start menu should popup, and should have a “Search programs and files” field at the bottom.
Enter “cmd” in this field. Don’t hit enter. It will search automatically.
“cmd” should be the top program found. This is the shortcut to the command prompt.
Right click the “cmd” result, and click “Run as Administrator”.
The command prompt should now appear.
You can confirm that you are running the command prompt as Administrator by looking at the window title. It will start with “Administrator:” when running “as Administrator”.
Commands executed within this Administrator command prompt will also be run “as Administrator”.
There may be times when you want to close a process from the command line on a Windows machine. The ‘taskkill’ command allows you to kill processes/programs by process id or exe name (image name).
You can do the same thing from the windows task manager, but sometimes this is not suitable. For example, if you have a number of Internet Explorer windows open, they will each run under their own process. If using the task manager, you have to kill each process separately. With taskkill you can specify to kill the exe/image name ‘iexplore.exe’ and it will terminate all instances of that process.
Example taskkill command:
taskkill /f /im iexplore.exe
/f = Forcefully terminate the process
/im = Kill processes based on image name (exe name).
Example screenshot:
Use the following command to get more taskkill parameters:
taskkill /?