Categories

AutoCAD 2015 and AutoCAD LT 2015 Bible

The most comprehensive AutoCAD book around!

Use the command line to launch programs

You may know that you can start certain Windows programs from the command line. These programs are in the acad.pgp file that defines aliases for commands. The first section has aliases for Windows commands.

To edit this file and add more commands, choose Tools > Customize > Edit Program Parameters. Notepad opens the acad.pgp file. Scroll down until you see the following:

Therefore, if you type explorer on the command line, Windows Explorer opens. To open a new file in Notepad, type notepad and press Enter at the prompt that appears.

If you add commands, use the same format. The text before these commands explains the meaning of the 1 and the general format. Then save the file. Back in AutoCAD, type reinit to reinitialize acad.pgp and you’ll be able to use your changes.

Tushar Dabholkar from Pune, India e-mailed me some more ways to launch programs from the command line.

You can type start on the command line and it functions like choosing Start > Run in Windows. For example, you can type winword or excel to open those programs (if you have them installed). Or type calc to open the Windows calculator or mplayer2 to the Windows media player.

Ellen Finkelstein

4 comments to Use the command line to launch programs

  • Mark Farrington

    Ellen-
    I have Civil 3D 2012 and can’t seem to locate the ACAD.PGP file by either using Windows Explorer or going through the Civil 3D program file root directory. Any idea where it resides?

    Mark

  • Ellen

    Mine is in the Support folder where AutoCAD is installed. It may also depend on your version of Windows. I just did a search in Windows Explorer for acad.pgp and it popped up.

  • Ray Thompson

    Mark,

    Try (findfile “acad.pgp”) at the command line.
    In mine, I get the following:
    “C:\\Users\\username\\appdata\\roaming\\autodesk\\c3d 2010\\enu\\support\\acad.pgp”

    This will give you the location of the pgp file that Civil is actually using. If I do a search using Windows Exploder, I also find the pgp file for Map and also the archived ones from years past.

    HTH,
    Ray

  • Tuomo Järvinen

    The following will show you which one your AutoCad uses, if you have several:

    (findfile “acad.pgp”)

    Copy and paste that to the command line. To directly edit the file you can use

    (startapp “notepad.exe” (findfile “acad.pgp”))

    To create a button-macro use

    ^C^C(progn (startapp “notepad.exe” (findfile “acad.pgp”))(princ))

    Read carefully the instructions in the beginning of the file. Make all your modifications to the end part of the file. And make a backup-copy first!

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>