I had kept these notes in a private wiki page for sometime. I hope moving it here will be helpful for searching.
Deleting a Service
sc delete servicename
To get name of the service that need to be deleted:
- Right click and get the service name
Checking whether a port is listening or not
netstat -na|find "PORTNUMBER"
To see all ports listening
netstat -na|find "LISTENING"
To check a service is started or not
net start|find "C:\Path\to\program"
Commenting in batch file
REM followed by a space
:: this is a comment REM this is another comment
Call a batch program inside another batch file
Query and remove terminal server sessions
qwinsta /SERVER:IP rwinsta /SERVER:IP
Check uptime of machine
net statistics server | find "since"
Run as different user