CreateShortcut fails

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • frederikbnielsen@gmail.com

    #1

    CreateShortcut fails

    Hi

    Im using the following code to create a shortcut on one of out network
    drives.

    WshShell shell = new WshShell();
    IWshShortcut link = shell.CreateSho rtcut(myURL) as IWshShortcut;
    link.WindowStyl e = 1;
    link.TargetPath = TargetURI;
    link.IconLocati on = @"%SystemRoot%\ system32\SHELL3 2.dll, 85";
    link.Save();

    It creates the link well enough, but i seem to have some kind of
    problem. When the users try to open the link, it starts the "Open
    with..." window. It should just open the network folder it links to.

    What i need it to do is to create a link from my code on one server
    and placeing the link on another.

    I have been trying several things and everything is fine when i create
    the link locally or from a 32 bit server. But from a 64 bit to a 32
    bit (my situation) is does not work.


    The strange part is if I open the properties of the link and change
    the simplest of things and apply them, it works all of a sudden.


    Can someone help me???
Working...