Run Command Prompt commands from a Windows shortcut

You know that you can run any Command Prompt command through a Windows shortcut located in the your work?

command_prompt

Of course you can open it Command Prompt (Command Prompt) and simply type the command you are interested in. Or, if you want to run more commands, you could create a script yourself (eg a bash script or a PowerShell script). But if you often use some specific Command Prompt commands, then it's not a bad idea to make shortcuts and run them with a double click instead of typing full-length rows every time. Let's see how you can do this

1. Create a shortcut by right-clicking anywhere on your desktop or in and by selecting Create> Shortcut.

2. Στο παράθυρο "Δημιουργία συντόμευσης" που θα ανοίξει, πληκτρολογήστε την εντολή σας, χρησιμοποιώντας την ακόλουθη σύνταξη:

"C: \ Windows \ System32 \ cmd.exe" / to yourcommand

The first part (the part in quotation marks) simply calls the cmd.exe command to open the command line. The / k switch tells the Command Prompt to run the following command and then stay on so that you can see the results or watch the process. You can also use the / c switch instead of the / k switch (use only one of the switches) if you want the command line window to close after the command is issued. And of course, yourcommand is the actual command you want to run.
Για παράδειγμα, αν θέλετε να δημιουργήσετε μια απλή εντολή για να τρέχετε το system file checker "έλεγχο αρχείων" ώστε να βρείτε και να διορθώσετε προβλήματα με τα αρχεία του συστήματός σας, θα πληκτρολογήστε τα εξής:

"C: \ Windows \ System32 \ cmd.exe" / to sfc / scannow

3. Όταν δημιουργήσετε την εντολή που θέλετε να χρησιμοποιήσετε, κάντε κλικ στο "Επόμενο". Πληκτρολογήστε ένα όνομα για τη συντόμευση και στη συνέχεια κάντε κλικ στο κουμπί "Τέλος".

shortcut

Now you can run the shortcut instead of opening the Command Prompt and typing the command manually at a time.

Another clever trick you can do is to send the results of a command directly to a text file (or another ). For example, let's say you want to run the command ipconfig /all , have its results saved to a file named ipconfig.txt on your desktop, and have the command prompt window close after the command is finished. You could use the following command:

"C: \ Windows \ System32 \ cmd.exe" / c ipconfig / all> "c: \ users \ username \ Desktop \ ipconfig.txt"

If you use the > symbol in the command above and the ipconfig.txt file already exists, then Windows will overwrite the contents of the file with the new results, so be careful not to lose any data you might need. If the file does not exist then Windows will create it. You can also use a double >> to have Windows add the new results without erasing the old contents of the file. Especially useful if you want to keep one about the results of a command.

iGuRu.gr The Best Technology Site in Greecefgns

every publication, directly to your inbox

Join the 2.087 registrants.

Written by Dimitris

Dimitris hates on Mondays .....

Leave a reply

Your email address is not published. Required fields are mentioned with *

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).