Disk Operating System (DOS)

MS-DOS (Microsoft Disk Operating System) is a single-user, single-tasking computer operating system that uses a command line interface. In spite of its very small size and relative simplicity, it is one of the most successful operating systems that has been developed to date.

Built-in Windows PowerShell commands, called cmdlets, let you manage the computers in your enterprise from the command line. Windows PowerShell providers let you access data stores, such as the registry and certificate store, as easily as you access the file system. In addition, Windows PowerShell has a rich expression parser and a fully developed scripting language.

Now a days, when we think of DOS, we are really referencing the windows command prompt.  Here are a couple of examples how you can use DOS, the windows command prompt, in your environment.

Example 1
Lock the windows screen using the command prompt.

rundll32.exe user32.dll, LockWorkStation

In the above, the rundll32.exe is used to run programs stored in DLL files. DLL's are Dynamic Link Libraries which are a collection of routines which can be used at run time instead of the traditional, old style, way of statically linking all libraries into an executable file. This allows multiple programs to use the same code from the library rather than having to carry around their own copies.

The user32.dll is the library that rundll32.exe will use and LockWorkStation is the function which will be executed.

When you put it together you cal lock the screen by running this at the command prompt.

Example 2
Send command line text to the windows clipboard.

type file.txt | clip

In this example, we are using the type command to output the contents of the file named file.txt.

normally, this would cause the file contents to be listed to the screen, but instead we use the |, a.k.a. the pipe key, to redirect the output to the windows clipboard.

This allows us to then paste the contents of the file where appropriate. This is a neat little feature because it illustrates the use of the pipe | whose full name is the pipeline operator.

The pipeline operator is used heavily when using the powershell scripting language. See here for an example.

Leave a Reply