Author Topic: Simplify Command Entry with Doskey Macros  (Read 2081 times)

0 Members and 1 Guest are viewing this topic.

Simplify Command Entry with Doskey Macros
« on: June 16, 2010, 01:51:34 PM »

Offline Nick

  • Administrator
  • Platinum Member
  • *
  • Posts: 46027
  • Karma: +1000/-0
  • Gender: Male
  • NickCS
    • http://www.facebook.com/nickcomputerservices
    • http://www.twitter.com/nickcomputer
    • Computer Chiangmai

Simplify Command Entry with Doskey Macros

Here's a quick and easy way to create short macros you can use at the command prompt.

The Doskey utility lets you encapsulate command strings as easy-to-enter macros. For example, by typing the following at the command prompt:

doskey 50=mode con:lines=50

you create a macro named 50 that executes the command string mode con:lines=50.To run a macro, you simply enter its name (in this example, 50) at a command prompt. You can create as many macros as you like with Doskey, but your macros are effective only for the current Command Prompt session.

To create a reusable set of Doskey macros, save them in a plain-text file, using an editor such as Notepad. Then load them from the command prompt, using Doskey’s /Macrofile switch. For example, if your macros are stored in your profile folder in a file named MyMacros.txt, typing:

doskey /macrofile=%userprofile%\mymacros.txt

makes those macros available for the current Command Prompt session. And if you regularly use the same macro file, you might want to consider using the AutoRun feature to load your macros.

For more information about using Doskey, type doskey /? at the command prompt.

From the Microsoft Press book Windows 7 Inside Out by Ed Bott, Carl Siechert, and Craig Stinson.

credit: technet.microsoft.com


 
Share this topic...
In a forum
(BBCode)
In a site/blog
(HTML)


Related Topics

  Subject / Started by Replies Last post
0 Replies
22166 Views
Last post April 11, 2009, 03:20:08 PM
by IT
0 Replies
2552 Views
Last post February 20, 2010, 01:26:13 PM
by Nick
0 Replies
2544 Views
Last post June 16, 2010, 06:01:54 PM
by Nick
0 Replies
2315 Views
Last post June 16, 2010, 06:04:06 PM
by Nick
0 Replies
1365 Views
Last post March 19, 2012, 07:24:03 PM
by Nick
0 Replies
1438 Views
Last post July 10, 2012, 03:33:46 PM
by Nick
0 Replies
1143 Views
Last post September 06, 2012, 01:11:00 AM
by Nick
0 Replies
1170 Views
Last post February 17, 2013, 06:15:11 PM
by Nick
0 Replies
1337 Views
Last post February 17, 2013, 06:16:25 PM
by Nick
0 Replies
1448 Views
Last post February 26, 2013, 07:23:59 PM
by Nick