LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview and file links in Windows

Hi,

I want to work with file and directory links (*.lnk) in LabVIEW under XP. My problems are:
-I cannot see, where a link points.
-I cannot copy the links (it results in a copy of the file/dir pointed to).
-I cannot create correct links.
-I cannot delete links (results in deleting the file/dir pointed to).

Is this possible with LabVIEW or do I have to use other programms (like cmd commands, if there are any).

Thanks for any information in advance.
MB
0 Kudos
Message 1 of 5
(2,547 Views)
Dear Marc,

yes it seems to be difficult to do shortcut manipulation with LV functions. I only needed once the possibility to create a shortcut during a Setup program. I haven't the VI available here at home. I will take it with me from my work place tomorrow.

I have detected that you can copy a shortcut in the command prompt. A workaround could be to create a command file and then call cmd with the command file as parameter with the system exec function. The File Dilaog function will not give back the name of the shortcut instead you will get the file name of the target.

I need to do a look into the MSDN if the shortcut functions I used will also provide a interface for the other functionality.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 2 of 5
(2,524 Views)
Dear Marc,

this is a VI I used to create shortcuts. Parts of the VI are hard coded so you need to convert some constants into controls to make it more general. Also it is a good idea to convert the location control into a strict typedef. The subVI GetShellLinkPath will look into the registry to determine the path where the link should be placed. It is restricted to the most common used paths and tries first to find a path for all useres under HKEY_LOCAL_MACHINE and if it will not exist there under HKEY_CURRENT_USER. It assumes that there will be an entry.

The setup I copied that VI from always installed for all users.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 3 of 5
(2,515 Views)
Thanks Waldemar for your VI's. I will check them.

...

Done. A shelllink.dll is missing. Can you send it, or the code of the dll, too?

Thanks in advance.
Marc

Message Edited by Marc Brandes on 04-08-2005 09:20 AM

0 Kudos
Message 4 of 5
(2,492 Views)
Hi Waldemar,

as I wrote, you use in your sample a dll (ShellLink.dll).
Without this dll, your vi does not work. Can you provide me with the ShellLink.dll?

Regards,
Marc

Message Edited by Marc Brandes on 04-19-2005 04:01 PM

0 Kudos
Message 5 of 5
(2,458 Views)