![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
windows |
30/03/2015 |
On utilise le module Win32::Shortcut.
#!/usr/bin/perl -w use Win32::Shortcut; $ApplicationName = 'c:/windows/system32/notepad.exe'; $BaseName = 'Notepad'; $lnk = new Win32::Shortcut(); $lnk->{'Path'} = $ApplicationName; $lnk->{'Arguments'} = ""; $lnk->{'WorkingDirectory'} = "."; $lnk->{'Description'} = "Launches application"; $lnk->{'ShowCmd'} = SW_SHOWNORMAL; $lnk->Save( $BaseName . ".lnk" ); $lnk->Close();
On est pas obligé de donner l'extension.
#!/usr/bin/perl -w use Win32::Shortcut; $ApplicationName = 'c:/usr/bin/WinSCP'; $BaseName = 'WinSCP'; $lnk = new Win32::Shortcut(); $lnk->{'Path'} = $ApplicationName; $lnk->{'Arguments'} = ""; $lnk->{'WorkingDirectory'} = "."; $lnk->{'Description'} = "Launches application"; $lnk->{'ShowCmd'} = SW_SHOWNORMAL; $lnk->Save( $BaseName . ".lnk" ); $lnk->Close();