use v5.14; use warnings; use Win32::OLE qw( ); my $wsh = Win32::OLE->new( 'WScript.Shell' ); sub read_shortcut { my $lnk_path = shift; my $shcut = $wsh->CreateShortcut( $lnk_path ) or die; return $shcut->TargetPath; } say read_shortcut( "a.url" );