From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I copy a link (*.lnk) to the startup folder?

I have a program that runs on about 20 PC's in Mexico for wire harness testing.  When I make changes i have to send a cd down with the programs and have the poor guy down there copy and paste the new version to the correct directories and this is very time consuming.  I decided that I would automate this by creating another labview program that zips a backup of the old program, stores it in a directory then copies the new one over.  Addiotionally I want it to automatically setup shortcuts in the startup folder for this to startup automatically.  My thought was to have the shortcut burned onto the cd then just use the file copy vi to copy the shortcut to the windows startup directory.  The problem is that the link is corrupted once it is copied to the hard drive.  I have broken it down to the simplest I can with a boolean case, a switch and copy in the true case.  When you press the switch the copy takes the file (shortcuts are .lnk files) and puts it in its target folder, but is no longer a proper shortcut.   Anyone have any ideas on how to do this or what I am doing wrong?
 
0 Kudos
Message 1 of 8
(3,415 Views)
rather than hassle with a shortcut, you could insert a "runonce" entry in the registry.  Just a thought.. If you want it to execute on every start up, then use the key Run instead of RunOnce
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce


Paul
0 Kudos
Message 2 of 8
(3,409 Views)
Hi,

LabVIEW 8.x has the option to create an installer that takes care of this (only not the backup-zip)

So no need to hassle files, just run the installer.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 8
(3,395 Views)
You would not happen to have a good example of this would you?  I normally am pretty good at working things out, however I try to stay away from that registry voodoo.  The last thing I need is a new dell brick on my desk because i was experimenting with registry vi's.  The included example doesn't really get into prgram launching, or anything useful for that matter.
0 Kudos
Message 4 of 8
(3,394 Views)
Shortcuts are logical shortcuts, so LV treats them as the original file. You can use DOS commands, but I would not necessarily recommend that. See here for an example.

___________________
Try to take over the world!
0 Kudos
Message 5 of 8
(3,388 Views)
Do I get a cookie? Down and dirty solution, but should work for you. Since you are on windows only.

Paul
Message 6 of 8
(3,380 Views)

Stradis wrote:
Do I get a cookie? Down and dirty solution, but should work for you. Since you are on windows only.



I left that cookie at your local grocery store... just put the cookie of your choice in your pocket and walk out, its on me.

 

Works great, It would have taken me many many months to figure out what you did.  I have not yet began to use properties, however i can clearly see how useful they can be.  Thanks again for the help!
0 Kudos
Message 7 of 8
(3,368 Views)
I tried to get my  cookie, but the cop did not buy it.... LOL.   keep in mind you still need the exe that I attached in the project.  it is what is responsible for creating the shortcut

Paul
0 Kudos
Message 8 of 8
(3,362 Views)