Flickr

Social Stuff
Site Info

Sponsored Links

Laurie's Entries

« Network Storage Device Alternate? | Main | A Passing of a Generation »

Running Scripts Without Type Their Extension on Windows

This is probably fairly trivial for some and for others it may be completely new. I had a feeling it existed, but I wasn't completely sure as I get my Linux, Windows, Cygwin, and Unix Utils all confused.

It's nice that you can run executables and batch files from the command prompt without typing their extension. However, when it comes to a Perl (.pl) file or maybe a PHP (.php) file, you'll have to type the extension.

Unless you change your PATHEXT environment variable.

For a one time change, just do this:

set pathext=%pathext%;.ext

This adds ".ext" to the search extensions for running executables.

To make the change permanent, change it on the environment variable settings on the advanced tab of your "My Computer" properties page.

I added the .pl extension using the following command:

set pathext=%pathext%;.pl

This will continue to work for that one command prompt session.

I hope this helps at least one person...

Posted by Shane on July 13, 2005 8:51 AM |

TrackBacks

TrackBack URL for this entry:
http://www.kf6nvr.net/mt/kf6nvr-tb.cgi/542