Return to Knowledge Base

MS DOS Commands

Useful MS DOS commands that everyone should know

In this article Iam going to list useful MS DOS commands which is supported on most versions of Windows OS.

Table of contents

  1. Identify running processes,
  2. Show current system date & time,
  3. Shutdown PC after specific time,
  4. Show any website IP address.

1-Identifying Running Processes on Win machines

Use the “tasklist” commands to view all running processes

Tasklist

You can output the result to txt file as follow

C:>tasklist >> output.txt

 tasklist1

Go to your C: directory and you will see a file named “output.txt” which includes the result of running “tasklist” command.

tasklist2

2-Show current date & time

C:>Date /t & time /t

date-time1

3-Shutdown PC after specific period of time

Open CMD or open the Run command and type the following

shutdown1

The above command stats that the system will be shutting down after one hour (1 Hour = 3600) , here we need to specify the time before the system turn off in seconds.

shutdown2

In windows XP the above screen will appear indicating that the system will turn off after one hour.

we can terminate the running command through typing the following

shutdown3

This will cause the scheduled shutdown to stop immediately

We can also type the following command  in the RUN window to shut down PC immediately

shutdown -s

We can also schedule a shutdown and warn the user with a message as follow

shutdown -s -t 600 -c "PC is going to shutdown after 10 Minutes!"

The following command will make the PC restarts after 2 minutes

shutdown -r -t 120 -c ” PC will restart after two minutes”

 

4-Show any website IP address

open command prompt and type the followng

nslookup <website name>

Ex:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\darknessgate>nslookup darknessgate.com
DNS request timed out.
timeout was 2 seconds.
Server:  UnKnown
Address:  192.168.1.1

Non-authoritative answer:
Name:    darknessgate.com
Address:  204.93.160.35

darknessgate.com IP address is 204.93.160.35

 

We can also do the same thing and find the IP address of a specific website through using the PING utility, to begin do the following:

Open command prompt , type PING <website name> then press ENTER

resolve name to IP address

resolve name to IP address

 

Permanent link to this article: https://www.darknessgate.com/knowledge-base/ms-dos-commands/