03-23-2011 04:57 PM
Is it possible to create a windows shortcut to a word document from my application?
I am creating a word document based on user input, and would also like to place a shortcut to that file elsewhere.
Thanks
03-23-2011 05:09 PM
There is a solution suggested here, it requires downloading an exe though.
03-24-2011 05:12 PM - edited 03-24-2011 05:20 PM
I got curious how to do it without an external exe.
Here you go... (see attached)
04-26-2011 11:26 AM
Troy - I'd like to take a look at your solution ... would you mind posting a version for those of us still back in 8.5?
Thanks.
04-26-2011 05:47 PM
Here ya go...
05-07-2012 02:06 AM
Hello everybody.
I have tried this example using windows 7, it does not work. A message says access denied. But you use windows xp, the example works perfectly.
I have administrator privileges. both windows 7 and windows xp
Thanks
05-07-2012 06:15 PM
The defaults set in the vi were designed to work in Windows XP.
The location and working directory need to be changed for it to work in Windows 7.
Here is one with the defaults set to work in Windows 7...
05-10-2012 04:18 AM
Hello Troy.
Do you know the location and working directory to create shorcut for all users in windows 7?. There are users don't have admin priviliges.
Thanks a lot.
10-24-2013 10:15 AM
When I run the Create Shortcut.vi, when the shortcut is created, and I look at the Properties of the shortcut, there are double quotes (" ") around the Target name. This shortcut points to an executable I am running. The double quotes around the Target causes problems when I try to try to run the executable by doule clicking the shortcut - an error comes up. If I go into the properties of the shortcut and remove the double quotes around the Target, and save, then when I double click the shortcut to run my executable, it runs just fine.
Any idea how/why the double quotes ends up in the Target field, and how do I make it so they don't appear when I run this Create Shortcut.vi?
10-24-2013 05:20 PM
The double quotes are automatically added by the ActiveX function when there is a space in the path.
If there is no space, there are no quotes.
Do you have a space in the filepath? Is the only space the one in the "C:\Program Files" part?
Try using %ProgramFiles% instead.
So "C:\Program Files\MyApp\MyExe.exe"
becomes %ProgramFiles%\MyApp\MyExe.exe
What I don't understand is why the quotes are creating an error. It always seems to work fine for me.
What is your full path? What error are you getting?