Thursday 20 October 2011

Customizing Windows Run Command...


If you are like me you use windows run command all the time.  I hate using the mouse to point and click a shortcut on the start menu.  WIN-R are probably the two most over used keys on my keyboard.  After thinking about if awhile I hunted down how the run command works.  It turns out that it makes a call to ShellExecute, which I guess is not too surprising.  The next thing I wanted to find out was exactly how the commands are resolved. The following is an ordered list of how they are resolved ([1]):
  • The current working directory
  • The Windows directory (no subdirectories are searched)
  • The Windows\System32 directory
  • Directories listed in the PATH environment variable
  • The App Paths registry key
Naturally the next thing I wanted to do was customize existing commands or add new commands so I do not have to type as much (standard lazy approach).  After examining my options which were to put the executable in one of those paths (since it only locates executables and not shortcuts), modify the path environment variable or add a key to App Paths. The App Paths option seems to be the easiest and most flexible to me.  Here is a layout of what you need to do to add an App Paths entry ([1]):
HKEY_LOCAL_MACHINE
    SOFTWARE
        Microsoft
            Windows
                CurrentVersion
                    App Paths
                        file.exe
                           (Default) = The fully-qualified path and file name
                           Path = A semicolon-separated list of directories
                           DropTarget = {CLSID}
Disclaimer: Modifying the registry can cause serious problems that may require you to reinstall your operating system. I cannot guarantee that problems resulting from modifications to the registry can be solved. Use the information provided at your own risk.
The minimum needed to add a new entry is to add the key file.exe where file is the string you want to type into the run command and to add the Default entry which is the fully-qualified path to the file you want to execute. Note that even it the file you are going to reference isn't an exe file you still need to put the .exe on the key. Here is a sample registry file that I created to add a shorter keyword for Internet Explorer:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ie.exe]
@="C:\\Program Files\\Internet Explorer\\iexplore.exe"
After entering that entry into the registry I can simply type “ie” at the run command to open internet explorer.
Here is a list of some common commands I use at the run command:
  • cmd – Command prompt
  • winword – Microsoft Word
  • excel – Microsoft Excel
  • outlook – Microsoft Outlook 
  • iexplore – Internet Explorer
  • firefox – Mozilla Firefox
  • notepad – Notepad
  • compmgmt.msc – Computer Management Console
  • control appwiz.cpl – Add/Remove programs dialog
  • mstsc – Microsoft Terminal Service Client
  • regedit – Registry Editor
If there is some program that I find myself using all the time I figure out what the run command is for it and if there is not a short easy one I add one to my App Paths as described above.  Does anyone else have some other common run commands they use?

Monday 17 October 2011

Secure your Desktop Icons and Settings :



You can save your desktop settings and secure it from your nerdy friend by playing with the
registry. 
Simply launch the Registry Editor go to:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer


In the right pane create a new DWORD Value named NoSaveSettings and modify it's value to


1. Refresh and restart for the settings to get saved.

Notepad tricks



Notepad Trick !
Well quite old but here is d complete collection
Step 1: Open Notepad
Step 2: Write following line in the notepad.
this app can break
Step 3: Save this file as xxx.txt
Step 4: Close the notepad.
Step 5: Open the file again.
Voilla!!
or
1> Open Notepad
2> Enter four words separated by spaces, wherein the first word has 4 letters, the next two
have three letters, and the last word has five letters
3> DON'T hit enter at the end of the line.
4> Save the file.
5> Close Notepad.
6> Reopen Notepad.
7> Open the file you just saved.
or
Open a note pad
type Bush hid the facts
save that file,
close it
again open and see...
NOTEPAD "world trade centre trick".. :Rahul
Did you know that the flight number of the plane that had hit WTC ...on
9/11 was Q33N ....Open your Notepad in ur computer and type the flight
number i.e Q33N... Increase the Font Size to 72, Change the Font to
Wingdings. U will be amazed by the findings.
log trick !! make ur Notepad a diary !!
Sometimes we want to insert current data and time, whenever we open the file in the
notepad. If you are a lazy person like me, who don’t like to press F5 whenever you open a
notepad. Then here is a trick to avoid this. Just add a .LOG in the first line of your text file
and close it.
Whenever you open the file with that text in the first line in the notepad, it will insert the
current date and time at the end of the file. You can start entering your text after that.
WHY?
The reason this happens:
In notepad, any other 4-3-3-5 letter word combo will have the same results.
It is all to do with a limitation in Windows. Text files containing Unicode UTF-16-encoded
Unicode are supposed to start with a "Byte-Order Mark" (BOM), which is a two-byte flag
that tells a reader how the following UTF-16 data is encoded.
1) You are saving to 8-bit Extended ASCII (Look at the Save As / Encoding format)
2) You are reading from 16-bit UNICODE (You guessed it, look at the Save As / Encoding
format)
This is why the 18 8-bit characters are being displayed as 9 (obviously not supported by
your codepage) 16-bit UNICODE characters
~ cheers ~
Changing Header and Footer
Ever printed the little text you wrote in Notepad? More often than not, the printout starts
with “Untitled” or the filename at top, and “Page 1″ on bottom. Want to get rid of it, or
change it? Click on File, Page Setup. Get rid of the characters in Header and Footer boxes,
and write what you want as Header and Footer. Use the following codes.
&l Left-align the characters that follow
&c Center the characters that follow
&r Right-align the characters that follow
&d Print the current date
&t Print the current time
&f Print the name of the document
&p Print the page number
Print tree root
a. Open NOTEPAD and enter {print tree root}
b. After that hit enter and type C:\windows\system
c. After that hit enter and type {print C:\windows\system\winlog
d. Hit enter and type 4*43″$@[455]3hr4~
e. Then save the file as teekids in C:\windows\system.
keep adding more