Command Line CMD Flashcards
What is the command line to change the TimeZone of the PC?
tzutil
What is the command to create a new user in the command prompt, and then set that user as an administrator?
net user username password /add
&
net localgroup administrators username /add
What command do i use to Online a disk using DiskPart?
What is the Command Prompt command to remove a user from the adminstrators Group
net localgroup administrators <username> /delete</username>
What is the Command Prompt command to check all users in the local administrators group?
net localgroup administrators
What is the Command Prompt command to disable a users account? (NB. It will not show up in Control/ Users anymore)
net user <username> /active:no</username>
How do you reference the current user in a script?
%USERNAME%
What is the Command Prompt command to disable a users account? (NB. It will not show up in Control/ Users anymore)
net user <username> <new_password></new_password></username>
What is the Command Prompt command to create a new user?
net user <username> <password></password></username>
What is the Command Prompt command to add a user to the Admin Group??
net localgroup administrators <username> /add</username>
What is the command to view the size of a folder?
Dir /s
What is the Command Prompt command to delete all files older then 28 days from C:\Windows\Temp
ForFiles /p “C:\windows\temp” /s /d -28 /c “cmd /c del /q @file”
Explanation of Parameters:
/p: Specifies the path to start searching.
/s: Instructs ForFiles to search inside subdirectories.
/d -28: Selects files with a last modified date older than 28 days.
/c: Specifies the command to execute (in this case, cmd /c del /q @file).