Follow-up question regarding shortcut creation/change

This is a multipart message in MIME format.
--===============1972044364==
Content-Type: multipart/alternative;
boundary="=_alternative 006CDA3386257347_="

This is a multipart message in MIME format.
--=_alternative 006CDA3386257347_=
Content-Type: text/plain; charset="US-ASCII"

Okay, gurus, you've helped me get this far, now....

Is there a WMI method to edit a desktop shortcut? Specifically, I need to
change the argument string from an IP address to the DNS name the IP
resolves to. For example, if the Target text of the shortcut is

c:\foo\foo.exe 255.255.255.255 1024

I need to change the "argument" part so the Target text becomes (if that
IP resolves to FOO15)

c:\foo\foo.exe FOO15 1024

Is there a way to do this? Or is it possible to edit the .lnk file in
Perl? It seems to be in binmode (I think?), and the argument part is
interspersed with CHR(0)'s between every character...

Thanks again,

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
--=_alternative 006CDA3386257347_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Okay, gurus, you've helped me get this
far, now....</font>
<br>
<br><font size=2 face="sans-serif">Is there a WMI method to edit a desktop
shortcut? Specifically, I need to change the argument string from an IP
address to the DNS name the IP resolves to. For example, if the Target
 text of the shortcut is</font>
<br>
<br><font size=2 face="sans-serif">        c:\foo\foo.exe
255.255.255.255 1024</font>
<br>
<br><font size=2 face="sans-serif">I need to change the "argument"
part so the Target text becomes (if that IP resolves to FOO15)</font>
<br>
<br><font size=2 face="sans-serif">        c:\foo\foo.exe
FOO15 1024</font>
<br>
<br><font size=2 face="sans-serif">Is there a way to do this?  Or
is it possible to edit the .lnk file in Perl?  It seems to be in binmode
(I think?), and the argument part is interspersed with CHR(0)'s between
every character...</font>
<br>
<br><font size=2 face="sans-serif">Thanks again,</font>
<br>
<br><font size=2 face="sans-serif">Deane Rothenmaier<br>
Programmer/Analyst<br>
Walgreens Corp.<br>
847-914-5150<br>
<br>
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</font>
--=_alternative 006CDA3386257347_=--


--===============1972044364==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1972044364==--
Deane.Rothenmaier [ Do, 30 August 2007 21:48 ] [ ID #1809187 ]

RE: Follow-up question regarding shortcut creation/change

This is a multipart message in MIME format.

--===============1898830095==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_09B8_01C7EB08.3F476DE0"
Content-language: en-ca

This is a multipart message in MIME format.

------=_NextPart_000_09B8_01C7EB08.3F476DE0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Win32::Shortcut is part of ActivePerl on Windows.



It won't give you anything than what you got from your WSH implementation, so I may not understand the real issue behind your
question.



Cheers,

-Jan



PS: Could you please use plain text messages on the mailing list? Makes it much easier to reply to individual parts of messages.



From: activeperl-bounces [at] listserv.ActiveState.com [mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
Deane.Rothenmaier [at] walgreens.com
Sent: August 30, 2007 12:49 PM
To: activeperl [at] listserv.ActiveState.com
Subject: Follow-up question regarding shortcut creation/change




Okay, gurus, you've helped me get this far, now....

Is there a WMI method to edit a desktop shortcut? Specifically, I need to change the argument string from an IP address to the DNS
name the IP resolves to. For example, if the Target text of the shortcut is

c:\foo\foo.exe 255.255.255.255 1024

I need to change the "argument" part so the Target text becomes (if that IP resolves to FOO15)

c:\foo\foo.exe FOO15 1024

Is there a way to do this? Or is it possible to edit the .lnk file in Perl? It seems to be in binmode (I think?), and the argument
part is interspersed with CHR(0)'s between every character...

Thanks again,

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


------=_NextPart_000_09B8_01C7EB08.3F476DE0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
[at] font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
[at] font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
..MsoChpDefault
{mso-style-type:export-only;}
[at] page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Win32::Shortcut is part of ActivePerl on =
Windows.<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><a name=3D"_MailEndCompose"><span =
style=3D'font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'>It won’t give =
you anything
than what you got from your WSH implementation, so I may not understand =
the
real issue behind your question.<o:p></o:p></span></a></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Cheers,<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>-Jan<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>PS: Could you please use plain text messages on the =
mailing
list?  Makes it much easier to reply to individual parts of =
messages.<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<div style=3D'border:none;border-left:solid blue 1.5pt;padding:0cm 0cm =
0cm 4.0pt'>

<div>

<div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt =
0cm 0cm 0cm'>

<p class=3DMsoNormal><b><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' >From:</span>=
</b><span
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' >
activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] <b>On Behalf Of =
</b>Deane.Rothenmaier [at] walgreens.com<br>
<b>Sent:</b> August 30, 2007 12:49 PM<br>
<b>To:</b> activeperl [at] listserv.ActiveState.com<br>
<b>Subject:</b> Follow-up question regarding shortcut =
creation/change<o:p></o:p></span></p>

</div>

</div>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal><br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Okay, =
gurus,
you've helped me get this far, now....</span> <br>
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Is =
there a WMI
method to edit a desktop shortcut? Specifically, I need to change the =
argument
string from an IP address to the DNS name the IP resolves to. For =
example, if
the Target  text of the shortcut is</span> <br>
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>  =
 
    c:\foo\foo.exe 255.255.255.255 1024</span> <br>
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>I need =
to
change the "argument" part so the Target text becomes (if that =
IP
resolves to FOO15)</span> <br>
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>  =
 
    c:\foo\foo.exe FOO15 1024</span> <br>
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Is =
there a way
to do this?  Or is it possible to edit the .lnk file in Perl? =
 It
seems to be in binmode (I think?), and the argument part is interspersed =
with
CHR(0)'s between every character...</span> <br>
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Thanks =
again,</span>
<br>
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Deane
Rothenmaier<br>
Programmer/Analyst<br>
Walgreens Corp.<br>
847-914-5150<br>
<br>
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</span><o:p></o:p></p>

</div>

</div>

</body>

</html>

------=_NextPart_000_09B8_01C7EB08.3F476DE0--


--===============1898830095==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1898830095==--
Jan Dubois [ Do, 30 August 2007 22:18 ] [ ID #1809188 ]

RE: Follow-up question regarding shortcut creation/change

>and the argument part is interspersed with CHR(0)'s between every
>character...

Sounds like Unicode to me. Unicode uses 16bit wide characters, and if
you're using English, you wouldn't use the second byte (making them all
zeros). =


-Wayne Simmons

--
Software Engineer
InterSystems USA, Inc.
303-858-1000
=A0 =

________________________________________
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of Jan Dubois
Sent: Thursday, August 30, 2007 2:18 PM
To: Deane.Rothenmaier [at] walgreens.com; activeperl [at] listserv.ActiveState.com
Subject: RE: Follow-up question regarding shortcut creation/change

Win32::Shortcut is part of ActivePerl on Windows.

It won=92t give you anything than what you got from your WSH implementation,
so I may not understand the real issue behind your question.

Cheers,
-Jan

PS: Could you please use plain text messages on the mailing list?=A0 Makes =
it
much easier to reply to individual parts of messages.

From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
Deane.Rothenmaier [at] walgreens.com
Sent: August 30, 2007 12:49 PM
To: activeperl [at] listserv.ActiveState.com
Subject: Follow-up question regarding shortcut creation/change


Okay, gurus, you've helped me get this far, now.... =


Is there a WMI method to edit a desktop shortcut? Specifically, I need to
change the argument string from an IP address to the DNS name the IP
resolves to. For example, if the Target =A0text of the shortcut is =


=A0 =A0 =A0 =A0 c:\foo\foo.exe 255.255.255.255 1024 =


I need to change the "argument" part so the Target text becomes (if that IP
resolves to FOO15) =


=A0 =A0 =A0 =A0 c:\foo\foo.exe FOO15 1024 =


Is there a way to do this? =A0Or is it possible to edit the .lnk file in Pe=
rl?
=A0It seems to be in binmode (I think?), and the argument part is intersper=
sed
with CHR(0)'s between every character... =


Thanks again, =


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
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Wayne Simmons [ Do, 30 August 2007 22:59 ] [ ID #1809189 ]
Perl » gmane.comp.lang.perl.active-perl » Follow-up question regarding shortcut creation/change

Vorheriges Thema: Linking files
Nächstes Thema: Win32 Wscript.Shell puts quotes around TargetPath?