Saturday, January 22, 2011

Creating folder which on Opening takes You to "Recycle Bin"

1.Assume folder name is RAJ,present in C:
    C:\RAJ

        My Computer
             |-------------->C:
             |                        |----->RAJ
             |                        |----->lock.bat
             |-------------->D:
                                     |---->key.bat
  
2.prepare a lock file.keep the lock file in c:
  Open a notepad and type the following

    ren RAJ RAJ.{645FF040-5081-101B-9F08-00AA002F954E}
     save the file. In file name type "lock.bat"   (include "")

3.prepare a key file.keep the key file in d:
  Open a notepad and type the following

  ren C:\RAJ.{645FF040-5081-101B-9F08-00AA002F954E} RAJ

save the file.In file name type "key.bat"   (include "")
______________________________________________________________________________

Note:key.bat,lock.bat should not be kept in same place,coz others can click key.bat to unlock the folder.
The location of key.bat should be known to you only.You may place key.bat anywhere.

Operation:

To lock the folder.Simply double-click lock.bat.The folder icon changes to Recycle-bin.
To unlock the folder.Simply double-click key.bat present in  D:

Modify as per your wish

Monday, January 10, 2011

Some times your ports are busy.

Exclusively for Web Developers

WhenEver you are developing your webapplication and your tomcat server/or any webserver fails to startup saying some is in use.  Here is the process to find out which port no is used by which service and kill that service to free that port
 


c:\>netstat -a -o       //displays all the process with their port and PID



 Protocol    Local Address :Port        Foreign Address                 State                     PID
 TCP                       raj:1033                   localhost:1034              ESTABLISHED         1692
 TCP                       raj:1034                   localhost:1033              ESTABLISHED         1692
 TCP                       raj:2008                   localhost:2009              ESTABLISHED         1376
 HTTP                     raj:2541                  localhost:12080            ESTABLISHED         1400




Suppose u want to free the port 2541.its pid is 1400


c:\>   taskkill /pid 1400 /f     //assuming PID=1400 is the process ID using that port /f for forcefully

            terminating the service with that PID

for more help
c:\>    taskkill /?
c:\>    tskill /?