Frage

I need to be able to run a few simple Perl scripts off of an NTFS (win server 2003 R2) drive. Is there any way to install Perl on this network drive (Strawberry or ActiveState, Strawberry preferred for built in cpan module compiler) and be able to run the scripts with whatever real time mounting on machines that do not have have/need a Perl distribution installed?

So far not having much luck with any relevant documentation.

War es hilfreich?

Lösung

Yes, we do this all the time.

Install Perl on your fileshare. I prefer to do this from the Windows Server hosting the fileshare, but I don't think it's necessary. If you don't have Remote Desktop and Admin access to that server, you'll need 2 PC's, 1 for the install and 1 to test this out. You can't test this on the same PC/server that ran the install.

Run this Windows Registry script on the test PC:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.pl]
@="Perl Script"

[HKEY_CLASSES_ROOT\Perl Script]
@="Perl Script"

[HKEY_CLASSES_ROOT\Perl Script\DefaultIcon]
@="C:\\WINDOWS\\system32\\Icons\\ActivePerl.ico,0"

[HKEY_CLASSES_ROOT\Perl Script\shell]
@="Open"

[HKEY_CLASSES_ROOT\Perl Script\shell\Open]
@="Open"

[HKEY_CLASSES_ROOT\Perl Script\shell\Open\command]
@="\"Z:\\network-folder\\Perl\\bin\\perl.exe\" \"%1\" %*"

[HKEY_CLASSES_ROOT\Perl Script\shellex]

[HKEY_CLASSES_ROOT\Perl Script\shellex\DropHandler]
@="{86C86720-42A0-1069-A2E8-08002B30309D}"

You will need to change this:

"C:\\WINDOWS\\system32\\Icons\\ActivePerl.ico,0"

to a path (preferably on the PC, not the network!) of an icon to go with the .PL files. You can drop those 2 lines from the reg script if you don't want a custom icon.

More importantly, you will need to change this:

"Z:\\network-folder\\Perl\\bin\\perl.exe\"

to the path where you installed Perl.

The DropHandler portion of that script is explained in more detailed in this other post: How do I create drag-and-drop Strawberry Perl programs?

Hope that helps!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top