Gurus,

I'm using a new part of WMI here, so I'm sort of lost.  I'm trying to 
create a desktop shortcut using Wscript.Shell. The problem I've got is the 
TargetPath method keeps putting double-quotes around the Target text, so 
the shortcut can't read it. 

----------------------- code ----------------------
use Win32::OLE;

my $WshShell = Win32::OLE->new( 'Wscript.Shell' );

my $oShellLink = $WshShell->CreateShortcut( 'foo.lnk' );

$oShellLink->{TargetPath} = 'c:\\foo\\foo.exe 23.14.15.20 1024';

$oShellLink->Save();

$oShellLink = undef;
-------------------------- code ---------------------------

The shortcut gets created, but when I open the properties tab for it, the 
"Target" text, c:\foo\foo.exe, is surrounded by double quotes. If I 
hand-delete the quotes and then double-click on the shortcut, foo.exe gets 
"found" and starts running, otherwise (with the quotes in place), a search 
window starts looking for it.  Is there a method in this object to 
suppress those quotes? Or am I missing something less obscure? Or less 
obvious?

I've tried assigning and using a variable for the target path:

$target = 'c:\\foo\\foo.exe 23.14.15.20 1024';
$oShellLink->{TargetPath}= $target;

But that doesn't help.

Any suggestions? 

TIA,

Deane Rothenmaier
Programmer/Analyst
Walgreens Corp.
847-914-5150

My goal is simple. It is complete understanding of the universe, why it is 
as it is and why it exists at all. -- Stephen Hawking
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to