How do I create a shortcut on a website’s desktop when using Chrome?

Asked

Viewed 292 times

2

I would suggest to the user when he enters my system create a site shortcut on his computer, this can be done manually by going to "Mais Ferramentas -> Adicionar a área de trabalho":

inserir a descrição da imagem aqui

How could I do this programmatically? Is there any Chrome api or native function that allows?

  • This is not only possible with Javascript, probably for security reasons.

  • It could be done as Notifications API, show a notification asking for permission, following this format there would be no security problem at all, the problem is to force the user to create a shortcut.

1 answer

0

Man, if I were you I’d make a file .bat and would call his execution with Javascript.

The Javascript file:

var objetoMan = new ActiveXObject("Scripting.FileSystemObject");
var WshShell = new ActiveXObject("WScript.Shell");
var oExec = WshShell.Exec("c:\\temp\\SeuArquivo.bat");

The archive .bat:

copy \\server\programa\NomeDoAtalho.lnk %userprofile%\desktop

Browser other questions tagged

You are not signed in. Login or sign up in order to post.