------------8<--------------------       
        As an PC support personnel, whenever we install an software
application for users, we need to create a shortcut of the program on
the desktop.  
         
        I would like to automate the above process. Which perl module or
extension is able to do the job?
------------8<--------------------

Please post in plain text.

I do remember vaguely there being a Win32::Shortcut module (not sure if
the hangover is playing tricks), but I don't remember getting it to
work. You can however utilise Win32::OLE to access WSH (do allow for
line wrap):-

use strict;
use warnings;
use Win32::OLE;

my $Target = "C:\\Program Files\\Whatever.exe";
my $objWSHShell = Win32::OLE->new('WScript.Shell');
my $objSC = $objWSHShell->CreateShortcut("C:\\Documents and
Settings\\$ENV{'USERNAME'}\\Desktop\\Justin.exe.lnk");

$objSC->{Description} = "Shortcut to Justin's executable";
$objSC->{HotKey} = 'CTRL+ALT+D';
$objSC->{IconLocation} = "$Target, 0";
$objSC->{TargetPath} = $Target;
$objSC->Save();




It's untested code but it should work.

Cheers,

Just (What do you call a bloke with a short . . . ) in 

_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to