Click to See Complete Forum and Search --> : win32::shortcut


Huxley
07-29-2004, 04:11 PM
I'm a perl newcomer, so please excuse any simple errors I make!

I'm using a script that requires the use of the win32::shortcut module and it works fine on my standard windows perl instilation at home, but when I try to upload it to a server (which has mod_perl) I get an internal server error.

Code

sub create_shortcut {
if (-e "$DIR/$FORM{ID}.lnk"){
$LINK=new Win32::Shortcut("$DIR/$FORM{ID}.lnk");
} else {
$LINK=new Win32::Shortcut();
}
$LINK->{'Path'}="$SERVER/$FORM{ID}.mp3";
$LINK->{'Arguments'}="";
$LINK->{'WorkingDirectory'}="/home/virtual/website.co.uk/var/www/html/";
$LINK->{'Description'}="$added";
$LINK->{'ShowCmd'}=SW_SHOWMAXIMIZED;
$LINK->{'IconLocation'}="$PATH/audio.ico";
$LINK->Save("$DIR/$FORM{ID}.lnk");
$LINK->Close();
}

Any ideas as to what could be going wrong would be great. Thanks,

Huxley

chrisranjana
07-30-2004, 02:45 AM
Is your server windows or linux ?

Huxley
07-30-2004, 04:17 AM
Linux I think...at least I can chmod!

silent11
08-03-2004, 01:16 PM
if you want to make a link, then look into "ln".

Sortcuts are for windows only right? Isn't this server a linux/unix server?

Huxley
08-03-2004, 06:44 PM
Ahh...so the shortcut module will only work on Windows servers? That explains it!

You see, I didn't write this script and I'm not really familiar with how perl works. But thanks for the help guys, I'll pass the info on. :)

CardboardHammer
08-04-2004, 12:02 AM
OT: Are you the same Huxley from [H]ardforums? I don't know jack about Perl, but I saw your name under the "last post" on the forum list and was curious.

At any rate, welcome to these forums.

Huxley
08-04-2004, 08:04 AM
No, different Huxley I'm afraid.

Thanks for the welcome though :)

CardboardHammer
08-04-2004, 08:57 AM
:cool: Ah well, I didn't actually know the other Huxley anyways, just knew of him.

While I'm pretty much useless with Perl, if you find a need for help with ASP/.NET, SQL Server, or SQL in general, I usually look through ASP/.NET, General, and Other for chances to contribute.

Cheers.