Table of Contents
This tip is about the how to Run Command Prompt Commands. So read this free guide, How to Run Command Prompt Commands step by step. If you have query related to same article you may contact us.
How to Run Command Prompt Commands – Guide
If you need to run Command Prompt commands regularly on Windows, it might be useful to save the command somehow so that you can run it whenever you need to without having to retype it. While you can use batch files for this, you can also use shortcuts. The main difference between the two options is that you can only run a single command using shortcuts, while you can run a series of commands and get better customization options when using batch files.
Adding commands as desktop shortcuts in Windows is a fairly easy process that requires zero knowledge of batch files and little knowledge of the commands you want to run. Basically you are using the %comspec% /k command followed by the command you want to run. For example, if you want to display the contents of drive c, use the command %comspec% /k dir c:. Comspec is a system variable that defines the command interpreter used on the system. If you haven’t modified this, cmd.exe is being used. The k parameter of cmd.exe keeps the run window open after the command is executed. If you don’t need it, you can replace it with /c which terminates it.
How to Run Command Prompt Commands with a Desktop Shortcut
%comspec% /k ping www.google.com will ping www.google.com when you double-click the shortcut.%comspec% /k sfc scannow will scan all protected system files when you double-click the shortcut.
Final note
I hope you like the guide How to Run Command Prompt Commands. In case if you have any query regards this article you may ask us. Also, please share your love by sharing this article with your friends.