dosdoskey

DOSKEY to change path and run a command


So I have two things I need to do, and it seems DOSKEY is the way to go but i am new to it. What I am trying to do is from the C prompt is change drives to D, then go into a folder called run_folder then execute a command that its redirect into a log file. So it would look like this.

C:\Users> D:
D:\> cd run_folder
D:\run_folder> run_command.exe > d:\run_folder\logs_current_date_time.txt 

I am trying to convert so that all i have to type is run_CA from the C prompt.. Any ideas? how i can accomplish this using DOSKEY


Solution

  • Put the three lines of code into a file named run_CA.cmd. Then you can type run_CA to execute it. No need for DOSKEY.