如何创建拖放式草莓 Perl 程序? [英] How do I create drag-and-drop Strawberry Perl programs?
问题描述
我有一个 Strawberry Perl 程序,它接受单个文件作为命令行参数.如何进行设置,以便我可以将所需的文件拖放到 Strawberry Perl 程序(或围绕它的包装器)上,并且程序以该文件的名称作为参数运行?
I've got a Strawberry Perl program that accepts a single-file as a command-line argument. How can I set things up such that I can drag and drop the desired file onto the Strawberry Perl program (or a wrapper around it) and the program runs with that file's name as an argument?
推荐答案
在 Windows 下(用 XP 测试),您可以创建一个 .cmd 文件并简单地让它运行带有 %1 参数的 Perl 程序来传递文件名结束,就好像命令行执行一样.
Under Windows (tested with XP), you can create a .cmd file and simply have it run the Perl program with the argument of %1 to pass the filename over, as if executed by commandline.
perl c: est.pl %1
然后你可以简单地将文件拖放到.cmd文件上执行.
Then you can simply drag and drop a file onto the .cmd file to execute.
这篇关于如何创建拖放式草莓 Perl 程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!