I want to execute perl scripts from command prompt without using "perl" before the script name nor do I want to use "Open with", "Select program" and "Always use this program". I've tried the following methods from various answers in Stack overflow but still haven't been successful in executing the script. I'm running these on "Windows Server 2016 OS"
I've installed Strawberry perl at "C:\Strawberry\perl\bin\perl.exe" and I've tried associating the .pl files as follows. (I'm using an admin command prompt window)
assoc .pl=PerlScript
ftype PerlScript="C:\Strawberry\perl\bin\perl.exe" "%1" %*
I've changed the registry key as follows.
reg ADD HKCR\Applications\perl.exe\shell\open\command /t REG_SZ /d "\"C:\Strawberry\perl\bin\perl.exe\" \"%1\" %*" /f
The operation completed successfully.
Even after these changes when I execute the perl script as follows, I get a file association popup rather than the perl script starting to execute, I do notice strawberry perl as an option (Perl Interpreter) which can be associated with the .pl file in the popup but why isn't the association already in effect and why is the popup still coming up?
test.pl
Can someone please help me with any kind of pointer as to what am I doing wrong or why this is happening please:( I want to execute the perl scripts using another automated script hence trying to get the association working without any manual intervention at runtime. Also I want this working the first time after the installation of the Strawberry perl on a brand new machine)