Command Line CMD Flashcards

1
Q

What is the command line to change the TimeZone of the PC?

A

tzutil

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the command to create a new user in the command prompt, and then set that user as an administrator?

A

net user username password /add
&
net localgroup administrators username /add

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What command do i use to Online a disk using DiskPart?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the Command Prompt command to remove a user from the adminstrators Group

A

net localgroup administrators <username> /delete</username>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the Command Prompt command to check all users in the local administrators group?

A

net localgroup administrators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the Command Prompt command to disable a users account? (NB. It will not show up in Control/ Users anymore)

A

net user <username> /active:no</username>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you reference the current user in a script?

A

%USERNAME%

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the Command Prompt command to disable a users account? (NB. It will not show up in Control/ Users anymore)

A

net user <username> <new_password></new_password></username>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the Command Prompt command to create a new user?

A

net user <username> <password></password></username>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the Command Prompt command to add a user to the Admin Group??

A

net localgroup administrators <username> /add</username>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the command to view the size of a folder?

A

Dir /s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the Command Prompt command to delete all files older then 28 days from C:\Windows\Temp

A

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).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly