LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-08-2008, 01:40 PM   #1
Slokunshialgo
Member
 
Registered: Jan 2006
Distribution: Ubuntu 9.04, Fedora 10
Posts: 76

Rep: Reputation: 17
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.
 
Old 01-12-2008, 03:58 PM   #2
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
Don't know if you've solved it but had a search and the only reasonable answer I could find was this ".lnk files are files which interpreted by the shell, when you execute a symbolic link file from DOS-shell, it finds the actual file to which the link points and executes it. To execute .link file from java simply use cmd /c *.lnk You can not omit cmd /c since Windows CreateProcess call does not know about .lnk files, they are interpreted by DOS shell." http://bugs.sun.com/bugdatabase/view...bug_id=4237760 Don't know if it's still valid. Plus a few about using filesystem view and other about parsing the lnk to extract the info , none that I can try out as (you've guessed, don't have windows handy)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
export Path=/usr/java:$Path does not seem to work lumix Linux - Newbie 1 03-19-2007 03:11 PM
LXer: Access z/OS batch jobs from Java LXer Syndicated Linux News 0 01-13-2007 01:21 PM
script to change unix path to windows path in all files csross Programming 8 04-29-2006 01:05 PM
Java Shell / Batch Scripts GenericProdigy Programming 4 11-18-2004 09:00 AM
Java can't find package, but PATH set correctly (j2se1.4.0, java.util.regex package) Ethan Programming 5 02-06-2004 09:55 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration