How to Use the Command Line - widberg/fmtk GitHub Wiki
.zip
/.tar.gz
Files
Extracting If the executable you downloaded is in a .zip
/.tar.gz
compressed archive then you will need to first extract it. 7Zip can be used to extract these files. It is important to do this before continuing since if the executable is not extracted then it cannot be used. Make sure that you have fully extracted the .exe
file from the compressed archives before continuing.
Opening a Command Prompt
When running a command line tool, it is important to make sure that the executable can be found by the command prompt. One way to ensure this is to open the command prompt in the same folder the executable is in. For steps to open a command prompt in a folder follow the directions here. Either Command Prompt (cmd.exe) or PowerShell (powershell.exe) should work.
Running an Executable
You can check that the executable can be found by typing the name of it into the command prompt, i.e. if the executable is named dpc.exe
then you should type dpc.exe
into the command prompt and press the enter key. If you get an error message like
'dpc.exe' is not recognized as an internal or external command,
operable program or batch file.
or
dpc.exe : The term 'dpc.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ dpc.exe
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (dpc.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
then the executable was not found and you need to make sure that the command prompt was opened in the correct folder.
You can check which folder the command prompt is open in using the command chdir
(or pwd
in PowerShell), this will print the absolute path to the folder. Use the file explorer to navigate to this folder and verify that the executable you are trying to run is there. If it is not then either copy the executable to this folder or open a new command prompt in the folder where the executable is. If you did not receive one of these error messages then the command prompt found the executable and you can proceed.
Passing Arguments to an Executable
Command line tools can be configured using arguments after the name of the executable in the command line. Such arguments are usually the name of the argument prefixed by a hyphen or two hyphens followed by a space and then the value for the argument. It is important to remember to put quotation marks around file paths with spaces in them, i.e. if you want to use the path C:\Users\me\my cool path
then you must surround it with quotation marks, "C:\Users\me\my cool path"
for it to work.
Troubleshooting
If the executable prints out an error message then take some time to read the message and try to understand what it is saying. For example, if the message says a file path was not found or does not exist, then make sure that for any path arguments, the path actually exists. If the executable says that an operation is not permitted but rerunning it with an additional argument would remove the restriction, then try to add the argument and run the command again. If you are unable to make sense of the error message then try to Google it. If you are still unable to resolve the error then ask for help on Discord or GitHub. Make sure to include the entire command you ran, the entire error message, and whether you used Command Prompt or PowerShell. This will make it easier to help you.