Skip navigation

JSI Tip 0403 - How do I open a command prompt with my favorite DOSKEY macros defined?

In tip 294 we learned how to create DOSKEY macros.

To open a Command Prompt with DOSKEY macros defined, modify the command prompt shortcut Target:

%SystemRoot%\system32\cmd.exe /k <Drive:>\path\file.cmd

where &ltDrive:>\path\file.cmd contains your macros.


%SystemRoot%\system32\cmd.exe /k  %HOMEDRIVE%%HOMEPATH%\Jerry.cmd

where %HOMEDRIVE%%HOMEPATH%\Jerry.cmd contains:

@echo off
doskey /macrofile=jsidoskey

and jsidoskey contains the doskey macros which you saved by typing:

doskey /macros > jsidoskey

If you want to see your macros being defined, then %HOMEDRIVE%%HOMEPATH%\Jerry.cmd would only contain the DOSKEY macros, such as:

doskey nd=md $1$Tcd $1
doskey [email protected] /d $1
doskey qf=format A: /q

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.