Monday, 22 September 2014
Mode of commands
Modes of commands
In this tutorial we are going to learn about "modes of commands".
Modes:
There are two different modes that are supported by DOS (Disk Operating System), they were.
1. Interactive Mode,
2. Batch Mode (Silent Mode).
There are two different modes that are supported by DOS (Disk Operating System), they were.
1. Interactive Mode,
2. Batch Mode (Silent Mode).
Interactive mode:-
In interactive mode, when a command is executed, it interacts with the user for input and depending upon the input supplied by the user, the further processes are carried out. For example, let’s take the ‘del’ command. The ‘del’ command is used for deleting files that reside inside a directory. Now I am going to delete all the files inside a folder named ‘abc’, and when I executed the following command, it is interacting with me prompting “Are you sure (Y/N)?”, confirming the deletion operation, and depending upon my input, it decides what to do. If I hit ‘Y’ then it will delete the files specified, else if I hit ‘N’ then it won’t delete.
In interactive mode, when a command is executed, it interacts with the user for input and depending upon the input supplied by the user, the further processes are carried out. For example, let’s take the ‘del’ command. The ‘del’ command is used for deleting files that reside inside a directory. Now I am going to delete all the files inside a folder named ‘abc’, and when I executed the following command, it is interacting with me prompting “Are you sure (Y/N)?”, confirming the deletion operation, and depending upon my input, it decides what to do. If I hit ‘Y’ then it will delete the files specified, else if I hit ‘N’ then it won’t delete.
C:\>del abc
C:\abc\*, Are you sure (Y/N)? y // it will delete all files from my abc directory.
if I execute C:\abc\*, Are you sure (Y/N)? n // it will not going to effect my any files from abc directory
C:\abc\*, Are you sure (Y/N)? y // it will delete all files from my abc directory.
if I execute C:\abc\*, Are you sure (Y/N)? n // it will not going to effect my any files from abc directory
Batch Mode (Silent mode ) :-
Batch mode can also be referred as ‘Silent mode’ or ‘Quiet Mode’, and this is mere opposite to the interactive mode. The command that operates at batch mode will never interact with the user at any instance, instead it will take care of every operation by itself. For example, I am going to explain this by using the same ‘del’ command. There is a switch available for the ‘del’ command, which makes the command to operate at silent mode, and that switch is ‘/Q’
C:\>del /Q abc
C:\>
In this case, this does not ask me to delete my files from abc directory, the command is not at all interacting with me, whether to delete those file or not. In the above example, I have tried to delete the same files in the same folder by using the same command but with a different switch. Anyhow both the commands will perform the same operation but the mode it operates differs. first was in interactive mode and another one in silent mode.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment