Page 1 of 1

IShortCut.Save -> does nothing?

Posted: Mon Jun 14, 2004 12:32 pm
by Niki911
Hi,

I tried and tried and tried - but IShortCut.Save does not seem to save any changes to an existing LNK-File ? :(

I am reading the LNK-File (which IShortCut does correctly) and can access all data like params, path etc.
Everything seems fine with that.
But if I change the IShortCut.Path to a new EXE and call SAVE - the LNK-File will not be changed at all....
(even with the TRYTORESOLVE-Param set to false)

Any ideas on that?

Niki

Posted: Tue Jun 15, 2004 9:54 am
by madshi
Can you please give me a piece of code which fails? It seems to work for me.

Posted: Tue Jun 15, 2004 1:40 pm
by Niki911
// I have tested/used this ONLY on Shortcuts in Startmenu/Autostart
// So please set filename to ANY Shortcut in that directory...

Link: IShortCut;
Filename: String;
Link:=LoadShortCut(filename);
Link.Path:='c:\windows\notepad.exe'; // for testing... makes no sense I know
Link.Save(Link.ShortCutFileName,false);

This SHOULD set the Shortcut-Target to the Notepad (or not?).
But it does nothing - the shortcut will be unchanged after this...

I am running WindowsXP (Pro with SP1) and using Delphi6Pro.

Niki

Posted: Sun Jun 20, 2004 1:56 pm
by madshi
Sorry for the delay, was on journey.

I've tried your code and it works just fine here on my XP. Could you please check whether the shortcut is valid after loading? ("if Link.IsValid then")