programming-examples/perl/Win32/Shortcut Attributes with the Win32_Shortcut Module.pl

16 lines
397 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl -w
use Win32::Shortcut;
$ApplicationName = 'c:/winnt/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();