Performing functions via the command line (Windows)

From ben.goodacre.name/tech

Jump to: navigation, search

Contents

[edit] Start/Stop Services

net start servicename
net stop servicename

[edit] Kill a local process

Download pskill

pskill /accepteula
pskill <process id or name>

[edit] Kill a process on a remote machine

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

[edit] Reset local account password

net user username password

[edit] Map a network drive

net use driveletter: \\server\share

[edit] Show running processes

tasklist

[edit] 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

[edit] Command line tips

[edit] Filter/grep output

To show all tasks called notepad:

tasklist|find "notepad"

[edit] Command line history

Press F7 or use the up and down cursor keys

[edit] Append to the %path% variable

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

[edit] See Also

Personal tools