Windows Commands

Useful Commands

List filenames in directory

dir /b /a-d

List directory tree

# To display the names of all the subdirectories on the disk in your current drive, type:
tree \

# To display, one screen at a time, the files in all the directories on drive C, type:
tree c:\ /f | more

# To print a list of all the directories on drive C, type:
tree c:\ /f  prn

Command History

doskey /history

IP Configuration

IP Configuration utility to remove the DNS cache

NETSTAT: Network Statistics

PING: Send Test Packets

TRACERT: Trace Route

TELNET

NSLOOKUP

SYSTEMINFO: System Information

EXECUTE COMMAND WITH INPUT

Sometimes we need to request new AWS session token with MFA enabled in order to update the session token credentials when it is expired.

For example: aws sts get-session-token --serial-number arn:aws:iam::123456789012:mfa/yourawsuser --token-code %otp% --profile yourprofile

If you do this manually and very frequent, you may consider to create a simple Batch Script file to prompt you to enter the MFA OTP.

Reference

Last updated

Was this helpful?