在Unix / Linux平台上运行的Perl脚本是否可以创建Windows快捷方式?

时间:2022-11-19 12:32:42

If I want to create a *nix symlink, I'll call symlink();, if i'm running a script on windows and I want to create a shortcut, I'd use Win32::Shortcut.

如果我想创建一个* nix符号链接,我将调用symlink();如果我在Windows上运行脚本并且我想创建一个快捷方式,我将使用Win32 :: Shortcut。

But what if I want to create a Windows shortcut if running a script from a *nix machine?

但是,如果我想从* nix机器运行脚本时创建Windows快捷方式该怎么办?

I'm accessing a SMB share on a Windows Server 2003 machine from my *nix machine.

我正从我的* nix机器访问Windows Server 2003计算机上的SMB共享。

2 个解决方案

#1


7  

Well, I don't know if Samba provides an API for that. On the other hand, Windows shortcuts are just .lnk files in a specific format.

好吧,我不知道Samba是否提供了API。另一方面,Windows快捷方式只是特定格式的.lnk文件。

#2


1  

It's been a long time since the initial question, but I've had the same issue and found a solution.

从最初的问题开始已经很长时间了,但我遇到了同样的问题并找到了解决方案。

I wrote an application whose goal is to allow anyone to create lnk files from any OS. I started writting it in bash and then I converted it in C (the sources are available).

我写了一个应用程序,其目标是允许任何人从任何操作系统创建lnk文件。我开始用bash写它然后我用C转换它(源可用)。

It's still fresh, so except me nobody tested yet, but you can have a look here :
  http://www.mamachine.org/mslink/index.en.html

它仍然很新鲜,所以除了我还没有测试过,但你可以看看这里:http://www.mamachine.org/mslink/index.en.html

#1


7  

Well, I don't know if Samba provides an API for that. On the other hand, Windows shortcuts are just .lnk files in a specific format.

好吧,我不知道Samba是否提供了API。另一方面,Windows快捷方式只是特定格式的.lnk文件。

#2


1  

It's been a long time since the initial question, but I've had the same issue and found a solution.

从最初的问题开始已经很长时间了,但我遇到了同样的问题并找到了解决方案。

I wrote an application whose goal is to allow anyone to create lnk files from any OS. I started writting it in bash and then I converted it in C (the sources are available).

我写了一个应用程序,其目标是允许任何人从任何操作系统创建lnk文件。我开始用bash写它然后我用C转换它(源可用)。

It's still fresh, so except me nobody tested yet, but you can have a look here :
  http://www.mamachine.org/mslink/index.en.html

它仍然很新鲜,所以除了我还没有测试过,但你可以看看这里:http://www.mamachine.org/mslink/index.en.html