Getting target path of Windows shortcuts in Java or batch
At work, we re-image all of the computers for student use from time to time. When we do, we need to test the image to make sure all the programs students might be using work properly. To do so, we have shortcuts to all the needed programs in a single folder, and a Java program that creates a script from these to run each shortcut.
This all works fine, except for one problem: When launching a shortcut in batch, it does not wait until the program closes before it moves on to the next one, so if there are 100 programs in the folder, it tries to open them all at once, which freezes the computer. However, I know that if I call a program directly (ie: C:\Programs\Name.exe) instead of the shortcut (ie: "Example.lnk"), it will wait.
We currently have a pause statement between each one, but my boss wants it changed so we don't have to go back to the command windows every time, but simply close one program, get the next to come up, no waiting, no having to hit a key, etc.
The exact language (Batch script, Java, C++) doesn't matter, but those 3 are ones I actually know how to code in. And although I realize this is a Linux forum, but hopefully somebody here has some idea to help with this. Any help is appreciated.
|