in reply to How to get URL associated with an existing Windows URL shortcut?
Works for me.
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" );
>perl a.pl https://www.perlmonks.org/
Are you sure you have the right file name?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to get URL associated with an existing Windows URL shortcut?
by cormanaz (Deacon) on Aug 03, 2023 at 14:14 UTC | |
by ikegami (Patriarch) on Aug 04, 2023 at 00:56 UTC |