Friday 14 June 2013

Useful CMD Commands

Hm... So for today I want to post something useful(?).

As a developer we need to know basic usage of Command Prompt. Why? For example if your program suddenly crashed. In unknown reason. And the error said, the IP was used by another process. But you don't know how you would achieve that. You could use netstat.

This is just one example. I wish this could be useful for you.

Find Server Name
nslookup 172.19.12.237

Find Port Used (Below is the example in finding netstat for port 80)
netstat -o -n -a | findstr 0.0:80

Kill process by PID
taskkill /PID

Flush DNS
If you cannot access your computer by domain name. Do the following Command
ipconfig -flushdns

Check Serial Number DLL
Use this on visual studio command prompt
for check serial number - SN -T DllNames.dll

Reset IIS
iisreset

Auto Shutdown windows with CMD command in 60 seconds
Auto Shutdown - shutdown -s -f -t 60

Synchronize
To synchronize time with Active Directory server run the following command
net time  /domain:domain.com /set

Copy and merge files
How to copy a csv files to be one big files. Start > Run > type "cmd"
copy *.csv name.csv

Find out is the port of your server is opened from client
telnet servername 80

I hope this post could be useful for you, and for your project. :)

Actually i have a lot of things to share with you. But almost all of them was just copying from another site. I think i will post it here someday.

No comments: