1

I'm trying to run a Perl program - WyD.pl - on Windows 7. I have Strawberry Perl installed, and the WyD installation folder is located at C:\wyd.pl-0.2.

Currently, running the program requires navigating to the WyD install directory in the command line, using cd "C:\wyd.pl-0.2", and then running it with wyd.pl.

How do I make it so that I can circumvent the first step entirely, and call the program with wyd.pl from any directory on the computer?

Hashim Aziz
  • 4,074
  • 5
  • 38
  • 68
  • Can you provide the output of the `assoc .pl` and the output `ftype NAME` (replacing `NAME` with whatever's on the RHS of `.pl=` in the ouput of `assoc .pl`). – ikegami Jan 26 '17 at 02:20
  • Never mind, @ikegami - you were right with your first comment yesterday. It turned out I needed to also add `.PL` to the PATHEXT environment variable. I'd come across that solution yesterday, but didn't think it was relevant because I'd never had to do it for the command-line programs I've run in the past, but obviously I didn't think about the fact that they were contained in `.exe` files, so already existent in `PATHEXT`. Thanks for your help. If you want to put it in an answer, I'll accept it. – Hashim Aziz Jan 26 '17 at 21:46
  • Re "*It turned out I needed to also add .PL to the PATHEXT environment variable*", I deleted that comment since `.PL` does not appear in my `PATHEXT` and it works on my machine. – ikegami Jan 27 '17 at 17:54
  • Interesting. What paths do you have stored in PATH? Also, do you use Strawberry Perl or another Perl distribution? – Hashim Aziz Jan 27 '17 at 18:12
  • The relevant path in `PATH` is `C:\wyd`. /// ActivePerl, but this has nothing to do with who built my Perl; this is all the OS. – ikegami Jan 27 '17 at 18:13
  • Okay, I just tested again, and it appears that I was probably getting confused between the two things I was trying to do. To clarify: having the paths set in the *PATH* envrironment variable allows me to call the program from anywhere on my computer using `wyd.pl`, which was the main focus of this question. At the same time, I was also trying to make it so that I could call with just `wyd` i.e., without the extension, which is what including the extension *.PL* in the *EXT* environment variable does. To confirm - are you able to call the program with `wyd` alone, *without* changing *EXT*? – Hashim Aziz Jan 27 '17 at 21:21
  • 1
    No, used `wyd.pl`. `PATHEXT` is what allows you to omit the extension. – ikegami Jan 27 '17 at 21:38
  • Pretty much confirms that, then. Just me being vacant-minded. I'm kinda embarassed to even write an answer now, lol. – Hashim Aziz Jan 27 '17 at 21:40
  • Your question would request a rewrite to be useful, so you could simply delete it instead. – ikegami Jan 27 '17 at 21:43
  • I'm considering rewriting it. Do you think it's likely to be flagged as duplicate if I do? – Hashim Aziz Jan 27 '17 at 21:45
  • 1
    Depends in which direction you change it. I don't know either way, though. – ikegami Jan 27 '17 at 21:59
  • I may as well go for it, unless you'd rather write it instead? I appreciate that you've spent a lot of time helping me, and if anyone should get the reputation for the simple answer that remains, it should be you. If you'd rather not, I'd be happy to. – Hashim Aziz Jan 27 '17 at 22:18

0 Answers0