Forrest logo
back to the doskey tool

doskey:tldr:3c6fb

doskey: Create a new macro.
$ doskey ${name} = "${command}"
try on your machine

This command is used in the Windows operating system to create a macro using the DOSKEY utility. The ${name} placeholder represents the name of the macro which you can choose, and the ${command} placeholder represents the command or series of commands that you want the macro to execute. The command structure doskey ${name} = "${command}" basically means that whenever you use ${name} as a command in the Command Prompt or a batch file, it will be replaced with the corresponding ${command}. For example, let's say you want to create a macro called print that prints the current date and time. You would use the following command: doskey print = "echo %date% %time%" Now, whenever you type print in the Command Prompt, it will automatically execute the command echo %date% %time%, which displays the current date and time. By using this command structure, you can define and customize your macros in the Windows Command Prompt environment, making it easier to execute frequently used commands without having to type them out each time.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the doskey tool