Move or Delete prompts Windows Message

When I use FolderItem.Remove or FolderItem.Delete on bulk file processes, sometimes Windows pops up a message that is not handled by XOJO.

The Windows message reads:

[quote]The item that this shortcut refers to has been changed or moved, so this shortcut will no longer work properly.

Nearest match on based on size, date, and type: …

Do you want to fix this shortcut to point to this target or do you just want to delete it?

[/quote]

It stops the XOJO program until the user selects an option, which is a problem because I want it to run unattended.

How do I prevent this window from popping up?

I should add this is my first posting in the XOJO forum. Thanks in advance for any assistance.

Use FolderItem.TrueItem or FolderItem.TrueChild (instead of FolderItem.Item or FolderItem.Child) to get a FolderItem that points to the shortcut file itself rather that the shortcut target.

[code]Dim root As FolderItem = GetFolderItem(“C:\Foo\bar”) ’ parent of the file to delete

Dim item As FolderItem = root.TrueItem(0) ’ first item in the directory
// OR
Dim item As FolderItem = root.TrueChild(“filename.txt”) ’ get child by name

item.Delete()[/code]

Andrew - I just looked up FolderItem.TrueItem.

Very helpful - Thank you for your prompt reply.

Alex

I used GetTrueFolderItem - that worked.