Blog dedicated to Oracle Applications (E-Business Suite) Technology; covers Apps Architecture, Administration and third party bolt-ons to Apps

Thursday, August 30, 2007

Windows command line fanatic

I am a command line fanatic. You can understand this if unix is the OS, but for doing a lot of tasks in windows, I use command line instead of the graphical user interface. Tasks like searching for files are more easily done through command line. For example if I have to find out whether a file whose name has the letters 11g, I can easily do so through the command prompt with the command dir *11g*. Compare this to GUI. I have to first start Windows Explorer or navigate through My Computer to that directory. If there are 500 files in that directory, Windows Explorer will faithfully show all 500. Then scroll and search for all files which have 11g in their name. Pretty tedious to me. Once I find the file names, I can simply type the first few letters of the file name press tab for the full filename to show up and press . Voila, the file opens in whatever application it is attached to. .txt files open in notepad, .doc files open in MS Word and so on. Much more faster than browsing through explorer.

I agree that certain tasks can be done faster on a GUI, but these searching and launching programs part is best done through command line in my opinion.

Some other things I achieve through command line:

Prevent Spyware
Windows is prone to spyware. The best way to prevent this is to login with a non-Administrator account. However you need to certain things as an administrator, for that you have to logout and start all over again ? No. Just launch a command prompt by clicking on start | Run | type: cmd. In your command prompt type:

runas/user:domain or machine name\Admin username cmd.exe

It will prompt you for password. Enter the password, this will launch a new command window as a user with administrator privileges. Anything you launch from this windows will be launched with admin privileges. For example you can start installation of Jinitiator or the latest Java Runtime through this window.

Killing unwanted processes

When you are not logged in as a user with admin rights, you may want to kill some processes through task manager which belong to Administrator user. For achieving this. Launch command prompt and follow the steps above to launch a new windows as admin user. Type: taskmgr to launch task manager as administrator. Kill any unwanted processes easily. Other option is to use the command tasklist to see the processes on command line character mode and use the command taskkill to kill with pid. Here's a copy paste of these commands:


Image Name PID Session Name Session# Mem Usage
========================= ====== ================ ======== ============
System Idle Process 0 Console 0 16 K
System 4 Console 0 44 K
smss.exe 1148 Console 0 48 K
csrss.exe 1284 Console 0 2,456 K
winlogon.exe 1308 Console 0 4,228 K
services.exe 1352 Console 0 1,992 K
lsass.exe 1364 Console 0 2,452 K
ibmpmsvc.exe 1548 Console 0 48 K
ati2evxx.exe 1576 Console 0 444 K
svchost.exe 1600 Console 0 1,556 K
svchost.exe 1656 Console 0 1,520 K
svchost.exe 2040 Console 0 13,496 K
svchost.exe 284 Console 0 1,136 K
svchost.exe 644 Console 0 212 K
ccSvcHst.exe 904 Console 0 3,108 K
AppSvc32.exe 1088 Console 0 1,632 K
spoolsv.exe 1452 Console 0 568 K
AluSchedulerSvc.exe 380 Console 0 484 K
ccSvcHst.exe 420 Console 0 240 K
SMAgent.exe 528 Console 0 64 K
alg.exe 1976 Console 0 144 K
explorer.exe 3012 Console 0 12,956 K
ccApp.exe 2648 Console 0 1,512 K
SynTPLpr.exe 3928 Console 0 300 K
SynTPEnh.exe 4076 Console 0 1,344 K
ctfmon.exe 1224 Console 0 548 K
symlcsvc.exe 3620 Console 0 176 K
svchost.exe 2332 Console 0 116 K
cmd.exe 3564 Console 0 1,112 K
ctfmon.exe 2216 Console 0 1,244 K
iexplore.exe 5936 Console 0 74,008 K
AcroRd32.exe 4228 Console 0 2,660 K
Extranet.exe 5980 Console 0 1,220 K
OUTLOOK.EXE 5132 Console 0 21,416 K
Connect.exe 5896 Console 0 6,420 K
firefox.exe 2020 Console 0 38,496 K
tasklist.exe 2904 Console 0 4,436 K
wmiprvse.exe 3916 Console 0 5,644 K
taskmgr.exe 2588 Console 0 5,072 K

C:\WINDOWS\system32>taskkill /pid 2588
SUCCESS: The process with PID 2588 has been terminated.

No comments: