2

I've noticed at one place that they was able to call FreePascal compiler as "fpc" from windows command line like:

fpc my_program_source.pas

How to achieve this? Is it some command that assigns "command => exeFile" ?

Thanks.

jave.web
  • 13,880
  • 12
  • 91
  • 125
  • possible duplicate of [Custom commands in windows Command Prompt](http://stackoverflow.com/questions/5181709/custom-commands-in-windows-command-prompt) – jave.web Mar 19 '14 at 08:56
  • They might be calling fpc.exe, you can always omit the extension. Your question isn't clear on what's being achieved. – Sertac Akyuz Mar 19 '14 at 09:53
  • 1
    The directory with fpc.exe has to be included in the PATH environment variable. – gammatester Mar 19 '14 at 11:09
  • 1
    If you run such files windows searches in the PATH – Marco van de Voort Mar 19 '14 at 12:05
  • @SertacAkyuz my question is like superclear ;) see possible duplicate, if my question wasnt clear enaugh for you :) – jave.web Mar 20 '14 at 13:44
  • @jave - Well, everyone else seem to have understand it. You're right, not for me though. When I saw the comment I thought why would this be a duplicate of that one. – Sertac Akyuz Mar 20 '14 at 18:33
  • @SertacAkyuz I admit I might have confused you with the Pascal thing, anyway - I then realized that what I want is a more general question. – jave.web Mar 21 '14 at 14:14

1 Answers1

2

Here's what to do:

  1. Find FPC.EXE on your computer. The brute force method would be

    DIR/S C:\FPC.EXE
    
  2. Go to the Windoze Control Panel and find System. Under the Advanced settings you should find a PATH variable.

  3. Modify PATH so that it looks like

    WHEVER-IT-WAS:C:\WHAT\EVER\DIRECTORY\YOU\FOUND\FPC\IN
    

Add a ":" and your directory.

  1. Open a NEW windoze DOS window

  2. Do

    FPC

  3. If this does not work, type

    ECHO $PATH

Make sure it has the directory you wanted is there. If not, a reboot might be in order.

user3344003
  • 20,574
  • 3
  • 26
  • 62