I'm trying to create an application shortcut from a desktop application using
Opennet.Desktop.Communication, however it keeps return an error

Dim rapi As New OpenNETCF.Desktop.Communication.RAPI
rapi.Connect()
rapi.CreateDeviceShortcut("\Windows\Start Menu\Programs\Myapp.lnk",
"\Program Files\Myapp\Myapp.exe")
rapi.Disconnect()

It creates a new file on the device, but when i click it i get an error of
bad file or must be signed. i check the properties of the new file and it is
different than a normal shortcut file. the target type is "file folder"
instead of application. it also does not show up as a shortcut file. am i
doing something incorrect in creating the shortcut or? i am using the latest
version of the opennetcf.desktop.communication dll.

Many thanks

Re: Creating shortcut from desktop by ctacke/>

ctacke/>
Fri Nov 23 11:50:15 PST 2007

My guess is that the spaces in the names are causing the problem - very
likely those in the second parameter. Try enclosing it in single quotes and
see what happens.


--

Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com



"Rob S" <RobS@discussions.microsoft.com> wrote in message
news:48F9EF43-7B97-43D2-8FD0-202F62DE453A@microsoft.com...
> I'm trying to create an application shortcut from a desktop application
> using
> Opennet.Desktop.Communication, however it keeps return an error
>
> Dim rapi As New OpenNETCF.Desktop.Communication.RAPI
> rapi.Connect()
> rapi.CreateDeviceShortcut("\Windows\Start Menu\Programs\Myapp.lnk",
> "\Program Files\Myapp\Myapp.exe")
> rapi.Disconnect()
>
> It creates a new file on the device, but when i click it i get an error of
> bad file or must be signed. i check the properties of the new file and it
> is
> different than a normal shortcut file. the target type is "file folder"
> instead of application. it also does not show up as a shortcut file. am i
> doing something incorrect in creating the shortcut or? i am using the
> latest
> version of the opennetcf.desktop.communication dll.
>
> Many thanks



Re: Creating shortcut from desktop by RobS

RobS
Mon Nov 26 00:54:00 PST 2007

Thanks Chris, i got it working in the end and it was indeed spaces it didn't
like.

This works:

r.CreateDeviceShortcut("\\Windows\\Start Menu\\Programs\\SAMS.lnk",
"\"\\Program Files\\SAMS PDA\\SAMS PDA.exe\"");

Thanks agai

"<ctacke/>" wrote:

> My guess is that the spaces in the names are causing the problem - very
> likely those in the second parameter. Try enclosing it in single quotes and
> see what happens.
>
>
> --
>
> Chris Tacke, eMVP
> Join the Embedded Developer Community
> http://community.opennetcf.com
>
>
>
> "Rob S" <RobS@discussions.microsoft.com> wrote in message
> news:48F9EF43-7B97-43D2-8FD0-202F62DE453A@microsoft.com...
> > I'm trying to create an application shortcut from a desktop application
> > using
> > Opennet.Desktop.Communication, however it keeps return an error
> >
> > Dim rapi As New OpenNETCF.Desktop.Communication.RAPI
> > rapi.Connect()
> > rapi.CreateDeviceShortcut("\Windows\Start Menu\Programs\Myapp.lnk",
> > "\Program Files\Myapp\Myapp.exe")
> > rapi.Disconnect()
> >
> > It creates a new file on the device, but when i click it i get an error of
> > bad file or must be signed. i check the properties of the new file and it
> > is
> > different than a normal shortcut file. the target type is "file folder"
> > instead of application. it also does not show up as a shortcut file. am i
> > doing something incorrect in creating the shortcut or? i am using the
> > latest
> > version of the opennetcf.desktop.communication dll.
> >
> > Many thanks
>
>
>