1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

How do I set programs to be run from the command prompt by typing their name?

Discussion in 'Windows XP' started by Trag, Apr 18, 2004.

Thread Status:
Not open for further replies.
Advertisement
  1. Trag

    Trag Thread Starter

    Joined:
    Sep 10, 2003
    Messages:
    72
    I'm just wondering how I can set the command prompt (winXP) to start up javac.exe(or any other program) when I type javac at the prompt.

    Thanks

    Joel
     
  2. Elvandil

    Elvandil

    Joined:
    Aug 1, 2003
    Messages:
    51,988
    Put the path in the environment variables in My Computer properties, Advanced.
     
  3. Trag

    Trag Thread Starter

    Joined:
    Sep 10, 2003
    Messages:
    72
    Hmm, I did that, and restarted my computer, but no luck. Anyone know what I did wrong?

    Joel
     
  4. Elvandil

    Elvandil

    Joined:
    Aug 1, 2003
    Messages:
    51,988
    You need to add the path to your program to the PATH variable.
     
  5. Trag

    Trag Thread Starter

    Joined:
    Sep 10, 2003
    Messages:
    72
    I did that, but still no luck. I restarted too, but that didn't do anything either. Do I need to put the name of the file in another variable as well?

    Joel
     
  6. Elvandil

    Elvandil

    Joined:
    Aug 1, 2003
    Messages:
    51,988
    Could you post the PATH variable and the path to your file?
     
  7. Trag

    Trag Thread Starter

    Joined:
    Sep 10, 2003
    Messages:
    72
    My path variable is below. The files I am trying to add, along with their paths are below as well. The files are: gcc.exe, g++.exe and javac.exe.
    I have tried both with and without the .exe extension as well.

    %SystemRoot%\system32;%SystemRoot%;
    %SystemRoot%\System32\Wbem;
    C:\Program Files\Common Files\Adaptec Shared\System;
    C:\GTK\2.0bin;
    C:\mingw\bin\gcc.exe;
    C:\mingw\bin\g++.exe;
    C:\j2sdk1.4.2_04\bin\javac.exe;

    Thanks

    Joel
     
  8. Elvandil

    Elvandil

    Joined:
    Aug 1, 2003
    Messages:
    51,988
    The last are the ones you added? You need to specify the directories for the path and not the specific executables or other individual files:

    %SystemRoot%\system32;%SystemRoot%;
    %SystemRoot%\System32\Wbem;
    C:\Program Files\Common Files\Adaptec Shared\System;
    C:\GTK;
    C:\mingw\bin;
    C:\j2sdk1.4.2_04\bin

    Then, you should be able to execute javac.exe by typing "javac" in the Run box.
     
  9. Trag

    Trag Thread Starter

    Joined:
    Sep 10, 2003
    Messages:
    72
    Thank you! It works perfectly
     
  10. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - programs command prompt
  1. Technoid1
    Replies:
    12
    Views:
    741
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/221595

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice