Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you write comments in doskey macro files?

Tags:

command-line

I have inherited a beautiful mess of doskey macros, and is trying to sort them by areas of concern. So far I haven't been able to find any references that mention comments in any way, but this seems such a common scenario that I'd be surprised if it is not supported in some way..

Is there any support for comments in doskey macro files?

Or do you have any other suggestions on how to achieve a similar goal?

like image 857
Haugholt Avatar asked Nov 15 '10 16:11

Haugholt


2 Answers

This page has an example of a workaround for comments in doskey.

This involves using ;= as a pseudo-comment e.g.

;= File listing enhancements. 
ls=dir /x $*
l=dir /x $*
ll=dir /w $*
la=dir /x /a $*

;= Remember to set the ; back to null at the end. 
;= Otherwise, you may trigger an error on load. 
;=
like image 119
James Broadhead Avatar answered Oct 17 '22 23:10

James Broadhead


I ended up splitting related commands into separate macro files, and running a bat-script to load them all. The bat-file then contains REM comments, while the doskey macro files are entirely comment-free.

REM Macros that deal with the XYZ project
doskey /macrofile=XYZ_macros.txt

(It is like a combination of James Broadhead's and eduffy's suggestions)

like image 20
Haugholt Avatar answered Oct 17 '22 22:10

Haugholt