Howto: To search a folder for files that contain a given search string

Searches for a text string in a file or files.

FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] “string” [[drive:][path]filename[ ...]]

/V         Displays all lines NOT containing the specified string. /C         Displays only the count of lines containing the string. /N         Displays line numbers with the displayed lines. /I         Ignores the case of characters when searching for . . . → Read More: Howto: To search a folder for files that contain a given search string

Howto: See if a local port is listening from command prompt

List local/remote socket and PID  for all TCP connections in “Established” state:

netstat -ano | find /i “established”

List local/remote socket for all TCP connections in “Established” state (sometimes you get more than above):

netstat -an | find /i “established”

List connections over time (netstat_check_connections.bat):

@echo off for /L %%X in (1,1,4) do (netstat -b . . . → Read More: Howto: See if a local port is listening from command prompt

Howto: Back up Server 2003 Users Groups Shares Permissions Program Names Network Settings

I cam across two amazing article the other day detailing how to do some great stuff from the windows command line.

synjunkie knows his shit:

Command-Line-Ninjitsu Command-Line Kung Fu

I stumbled upon it because I was about to format a server but wanted to retain this information:

All local groups/users and their respective permissions for . . . → Read More: Howto: Back up Server 2003 Users Groups Shares Permissions Program Names Network Settings

Howto: Restart a Windows Computer Remotely or Via RDP

To restart a machine remotely use the following (from command prompt):

shutdown /m \\computer -f -r -t 1

To restart if you are already RDP’d in to the machine (from command prompt):

shutdown /f /r /t 1