Performing functions via the command line (Windows)

From ben.goodacre.name/tech

Jump to: navigation, search

Contents

Start/Stop Services

net start servicename
net stop servicename

Kill a local process

Download pskill

pskill /accepteula
pskill <process id or name>

Kill a process on a remote machine

pskill \\hostname -u username <process id or name>

Reset local account password

net user username password

Map a network drive

net use driveletter: \\server\share

Show running processes

tasklist

Add a user to a local group

net localgroup localgroupnamehere /add usernamehere

For example to add domain\user to the local administrators group:

net localgroup Administrators /add domain\user

Command line tips

Filter/grep output

To show all tasks called notepad:

tasklist|find "notepad"

Command line history

Press F7 or use the up and down cursor keys

Append to the %path% variable

SET PATH=%PATH%;"insert additional path here"

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox