Friday, September 03, 2010

Useful Windows Tips [I've been gathering over a period of time]

I very much enjoy doing the various common tasks on Windows using various shortcuts Microsoft provides.

I've captured some of such important tips in a txt file till now. Just thought will post it in to the blog, so that I can continuously append the tips to it:

I've as such not formatted it much. [May be I'll do later, as of now just a copy paste from txt :)]

================================================

1) Add your own commands to WINDOWS+R commands:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

2) equivalent to cd -
    pushd     [It will store PWD and cd to new dir]
    popd            [to come back to old dir]



3) Without opening outlook, how to open a new mail window:
Windows + Run ==> Type mailto:

there comes the new outlook mail window,,


4) Access Windows clipboard from command line(both read and write) using clip.exe which comes with Windows Server 2003. Same file can be found here clip.zip
  * dir /h | clip – Copy the help manual for DIR command to the clipboard
   *  clip < C:\AUTOEXEC.bat – this will copy all the text from autoexec.bat to your Windows Clipboard.

#unix diff
fc.exe : Compare files

mem: Display memory usage

pause:

#unix history equiv
doskey /history

#search commands in history:
enter starting of command and press F8

#command to get free space
fsutil volume diskfree C:

#cd - of UNIX
pushd .
cd
popd

#cat
type
more

#change IP
conf_ip.bat

#grep
find/findstr

#alias for commands
doskey ct=cleartool

>If you want to start a program (like DOSKEY) or set an environment variable each
>time you open a command prompt:
>
>1. Start Regedit
>2. Go to HKEY_CURRENT_USER\Software\Microsoft\Command Processor
>3. Create a String key called Autorun
>4. Give it the value = c:\autoexec.bat
>5. Multiple commands need to be separated by a double ampersand (&&)


wikipedia windows commands

#for in windows
for %a in (*.*) do cleartool lsvtree -g "%a"

#list of all running processes with full parameters.
WMIC /OUTPUT:C:\ProcessList.txt path win32_process get Caption,Processid,Commandline


#for sleep,,,use the windows resource tool kit sleep.exe..it works
c:\Program Files\Windows Resource Kits\Tools\sleep.exe


#infinite loop in windows
for /l %i in (1,0,2) do

#start miniminsed
start /min

#current date
%date%

#multiple commands at once in windows
(ovpacmd stop
ovpacmd start
.
.
)
Also, & can be used
 command1 & command2
 Execute Command1 and then execute Command2



If you want to print the latest time in command prompt:
time /t (only HH:MM )
echo %time% (more detailed)
================================================


Textpad tips
================================================
General important things, which I will never forget, so only one words for them


- Block Selection
- Sort
- compare files
- clip library
- changing the "File Type" and "Code Set" while Saving As,,
- bookmarking and edit operations on those bookmarked lines,
- Find in files,,


- While finding/replacing in files, you can also pass regular expression to it. It handles
  = "\n", \t"
  = Give ^ in find field and in replace field, it adds the at the begining of all the lines.

  = Give $ in find field and in replace field, it adds the at the ending of all the lines.


================================================


Linux tips
================================================
1) Print one line from a file:
  - sed -n 3p file [Prints 3rd line]
2) Print one column from a file:
  - cut -c5-7 somefile [Prints columns 5 to 7]
================================================

Cheers
Santhosh

No comments:

Post a Comment