Posts

Showing posts from November, 2012

Want a post written on a selected topic? Suggest it.

Hey peeps!!! I kind of feel like pleasing someone. So i give the opportunity for anyone to write a topic on which they want me to write a post. If the topic is computer related and i can get enough information, i will write on it within the shortest possible time. You can either put the topics in the comment field below or contact me with your topics. Always remember that, anyone who will like to contribute a post on this site is always welcome, as long as it is a computer related post.

Meet The Command Prompt - The Date Command

Image
This is a fairly simple command to use. The date command simply displays the current date. When this command is run without arguments, It first displays the current date, then prompts for a new date to be entered. You can simply press enter to keep the current date. When you don't want to be prompted for a new date, you can use the /t switch. This switch when used will simply display the current date

Meet the command prompt - The CD command

When working in the windows command interpreter, there is always a current working directory. This is the directory that is shown at the prompt. In the screenshot below, the current directory is D:\Windows\system32. When a command is run with no arguments, it simply displays the current directory path. Open the command prompt and simply type cd . You will see you current working directory displayed. The CD command takes a path argument when you want to change the working directory. For example, to change the current working directory to the windows temporary directory, you can type something like  cd %temp%  or cd D:\Users\Staphy\AppData\Local\Temp (depends on your operating system)

Meet the command prompt - the REN command

The RENAME command can be used instead of this command - they do the same thing. What they do (as the names suggest) is to rename a file. It takes two arguments; the file to be renamed and the new name to be given to the file. It takes the form ren file1 file2. Here, file1 is the path to the file to be renamed. file2 is the new name to be given to the file. After this command is executed successfully, there file specified by file1 no longer exists. If the file existed before, its name will be changed to file2. Note however that, the file name includes the extension.

Meet the command prompt - the pause command

Image
This command is mostly used in batch scripts. What it does is simply to suspend processing/execution of the batch script until the user presses any key. It gives the prompt for the user to press any key to continue. You may want to use this command when you want the user to see a particular output. For example: @echo off echo Hello there!! echo My name is Staphy echo Nice meeting you. echo I hope we'll get along very well pause The Pause Command  

Meet the command prompt - The exit command

As the name suggests, the exit command exits something. This "something" can either be the command interpreter or a batch program/script. The command is very simple to use. It is as simple as typing exit. When it is a batch script you want to exit from, You will need to do something extra, you will add a /b switch with an exit code.

Meet the command prompt - The color command

Image
The command prompt window by default has a black background with a white foreground. Unfortunately, this scares some people. Some other person may want to write in a different color on a different background color. That is what the color command is for. The color command takes an argument or not. When the color command is executed without an argument, it simply restores the color of the command interpreter to the initial color - that is the foreground and background that were used when you started the command interpreter.

Meet The Command Prompt - The Time Command

This is a fairly simple command to use. The time command simply displays the current time. When this command is run without arguments, It first displays the current time, then prompts for a new time to be entered. You can simply press enter to keep the current time. When you don't want to be prompted for a new time, you can use the /t switch. This switch when used will simply display the current time. time /t         -    displays the current time time          -    displays the current time and prompts for a new one time 11:11:11.11     -    sets the current time to the specified time

Meet the command prompt - the RD command

Like the CD and MD command, the RD command also has a twin. Its twin is the RMDIR command. These commands are for deleting directories. To delete a directory using this command, just type MD followed by the name of the directory to be deleted. If the directory to be deleted is not in the current working directory, you may need to specify its full path, or change the working directory. Using the command this way will fail if you intend to delete a folder that is not empty. To delete a non empty folder, you need to use the /s switch. Using this switch deletes the directory specified and all files and folders it contains.

Meet the command prompt - the MD command

This command has a twin, MKDIR . Their function is to create a new directory (folder). The command creates all the directories that do not exist. This command can be use to create a directory structure some levels deep. for example md folder1\folder2\folder3 The above command will create three folders. the folder named folder1 will be created in the current directory. In folder1, there will be another folder named folder2. This folder will also contain the third folder, folder3. This command has quite some "power". Look at the post on how to create an undeletable folder.