dannyt Posted April 19, 2010 Report Share Posted April 19, 2010 Hi I wonder if anybody could give me pointers in creating a Windows XP desktop shortcut with LabVIEW or how edit an existing one. Working in LabVIEW 8.2.1 I can see how to do this with WshShell commands (the Windows shell scripting environment) but not with LabVIEW. I did try playing around with the "IWshRuntimeLibrary.IWshShell2" ActiveX object but though I can find a CreateShortCut invoke method I seem unable to do anything constructive with it. cheers Dannyt Quote Link to comment
asbo Posted April 19, 2010 Report Share Posted April 19, 2010 Have you looked up the IShellLink interface? There's probably a third-party commandline interface available somewhere if you look hard enough. Quote Link to comment
Popular Post bmoyer Posted April 19, 2010 Popular Post Report Share Posted April 19, 2010 I use these VIs. They're from a bunch of Windows utility VIs that I have. Bruce Create Shortcut.vi Set Shortcut Properties.vi 5 Quote Link to comment
dannyt Posted April 19, 2010 Author Report Share Posted April 19, 2010 Have you looked up the IShellLink interface? There's probably a third-party commandline interface available somewhere if you look hard enough. I will have a look at IShellLink thanks. I was try to avoid a thirdparty option if possible and just do it with LabVIEW so I did not have to deploy anything out with the LabVIEW. Maybe there is a registry key ? If I was going in the thirdparty direction I could code up a WSH example myself 'Create a Desktop ShortCut set WshShell = WScript.CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") set oShellLink = WshShell.CreateShortcut(strDesktop & "\Shortcut To Notepad.lnk") oShellLink.TargetPath = "Notepad.exe" 'WScript.ScriptFullName oShellLink.WindowStyle = 1 oShellLink.Hotkey = "CTRL+SHIFT+N" oShellLink.IconLocation = "notepad.exe, 0" oShellLink.Description = "Shortcut To Notepad." oShellLink.WorkingDirectory = strDesktop oShellLink.Save cheers Dannyt Quote Link to comment
Popular Post bmoyer Posted April 19, 2010 Popular Post Report Share Posted April 19, 2010 Sorry, my examples posted earlier were in 8.5.1. Here they are back saved to 8.0. Bruce Create Shortcut.vi Set Shortcut Properties.vi 4 1 Quote Link to comment
dannyt Posted April 20, 2010 Author Report Share Posted April 20, 2010 (edited) Sorry, my examples posted earlier were in 8.5.1. Here they are back saved to 8.0. Bruce Bruce, many many thanks to you for that, works a treat, +1 rep to you sir :-) LAVA to the rescue again. I was at least please I was heading onto the right lines NOTE for anyone else downloading the 8.0 version, you file Create Shortcut.vi has the 8.5 version of Set Shortcuproperties in it so remember to put the new 8.0 one in its place Dannyt Edited April 20, 2010 by dannyt Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.