Protiviti / SharePoint Blog

SharePoint Blog

October 24
7 No Brainers to make Command Prompt work a breeze

Depending on your job, it may be days or even months between command prompt usages. It is easy to forget the simple commands that can help the command prompt seem not as scary. Below are some of my favorite commands that could easily slip your mind if they are not being used on a regular basis!


1.       Run As Administrator

Permissions are a crucial part of IT administration. Without the correct permissions, the command prompt could lose a lot of its valuable tools.

becca 10.24.141.PNG 

Your first step should be to right click on the command prompt shortcut and “Run as administrator”. As a habit, I do this whenever I am using the command prompt. If you are running as Administrator your command prompt, you should see “Administrator:” in front of Command Prompt. 

 becca 10.24.142.PNG

2.       Clear Screen

Sometimes it is easier to clear the screen and start over. Being a neat and organized person, this is one of my favorite commands and also the one I have the most trouble remembering! I’m always tempted to spell out the word instead of “cls”.

becca 10.24.143.PNG 

The next command comes in handy, especially after clearing my screen.


3.       Previous Commands

This command is guaranteed to speed up your work. To access previous commands, used during your current command prompt session, use the up arrow. This will allow you to step through your most recent commands and execute any of them again without retyping. This is perfect for when you have a long command you just typed, but you need to change one parameter. Once you bring up the command you can use the right and left arrow keys to navigate and change parameters.

4.       Change Directory

If you’re like me, then you use folders to organize. However, this means you might end up 8 levels deep and need to back up a few. A great way to back up two levels without typing the whole path is to use the following command:

becca 10.24.144.PNG 

For each level you want to back up, include a “..\” after the cd command. This is a great way to navigate the folder structure.

5.       Tab

Have something on the tip of your tongue? I bet you wish you could tab and autocomplete your sentence! In command prompt you can. Use the tab to finish what you are typing based on the context of the command prompt. For example if you know you have a file that starts with a “T”, type “T” and select tab. You can continue to hit tab until your file comes up on the command prompt.


6.       To Text

If you have ever had a console application print information to the command prompt and wish you had it in a document to search, then this is for you! Add this command to the end of any console application execution and be able to refer back to all that information you need:

 becca 10.24.145.PNG

The syntax consists of a “>” followed by the file name an extension. This will place your file in the same location your command prompt is pointed to. In the above example, the myResults.txt will be saved to the c drive.


7.       Copy

If you have ever needed a copy of a dll, then you know how handy this command is. For those of you who are not familiar with the GAC, you can’t copy assemblies from the GAC with solution explorer.  Instead navigate to GAC_MSIL and the appropriate sub-folder from the command prompt, then copy the dll to a neutral location using the following command:

 becca 10.24.146.PNG

The command consists of “copy” followed by the name of the file to be copied and finished with the new copy location. In the above example, Microsoft.AnalysisServices.DLL gets copied to the c drive.

There are many more tips and tricks to making command prompt easier to work with. These seven are the ones I use on a regular basis. I hope you find these commands as useful as I do! 

Quick Launch

© Protiviti 2021. All rights reserved.   |   Privacy Policy