Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate Windows .lnk file with PHP

I'm working on a project which involves an FTP server running ProFTPd and a PHP/MySQL backend that creates accounts for users.

Upon the creation of accounts, users are sent e-mails with their account details and instructions for downloading FileZilla or CyberDuck, depending on their OS, detected via user-agent string.

To make things easier for novices, I thought of having .lnk files generated for FileZilla with the account logins details as parameters, so they would just have to click on the .lnk files to open up the server. This is not a crucial feature but more of a technical challenge.

My questions are :

  • is this even feasible ? are there any alternatives (eg. generating a .bat with a script pointing to the Filezilla executable ?)
  • are there any issues, perhaps with relative / absolute paths pointing to the executable ?
  • to go even further, what would be the simplest way of providing users with software with FTP access on a single account / single server (web interface is not an option).
like image 438
Andrei Avatar asked Nov 30 '25 04:11

Andrei


1 Answers

It's very difficult to create .lnk files programmatically. See this answer.

In FileZilla, I think the best you can do reliably is to pass along a filezilla.xml file, and describe the steps necessary to import it after FileZilla has been installed.

like image 136
Pekka Avatar answered Dec 02 '25 18:12

Pekka