Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to launch an application using a link

Status
Not open for further replies.

fhutt

Programmer
Jul 7, 2006
79
AU
Hello
I would like to launch an application by using a link.
I tried the 'exec' function but I get an error saying the file cannot be executed.

Can anyone please help
Fhutt
 
I don't know about anyone else, but I'm not sure what you're asking. Are you saying that you want to launch a non-Tcl application (like, say, a .exe file on Windows) from within a Tcl script? If so, what do you mean by "link"? If not, what are you trying to do? Sorry to be obtuse but I don't see what you're getting at.

_________________
Bob Rashkin
 
Hello Bong
I am trying to execute a link something like this:

'exec filename.lnk'

where filename.lnk is a link to a file dbmgt.exe.
The procedure 'exec dbmgt.exe' works. but using the link file gives an error saying that the file cannot be executed.
Hope you understand my problem now.
Thanks
Fhutt
 
I think I understand. I believe the problem is that "xxx.lnk" cannot be executed from a DOS shell so Tcl's "exec" won't do it either. As a simple experiment, open a DOS shell and type in "<whatever>.lnk" where "<whatever>" is a shortcut in the current directory. You'll get an error. I think it's because the .lnk's are Windows executables, not DOS executables.

_________________
Bob Rashkin
 
Hello Bong

Yes, you are right, it does not execute from a cammand prompt.

So, how do I execute the 'filename.lnk' through a TCL script?

Thanks
Fhutt
 
I don't think you can. You would have to launch Windows and I don't think that would be a very productive approach.
Tcl only supports symbolic links and Windows does not use them.

_________________
Bob Rashkin
 
Hello Bong
Maybe there is simple program or script that can extract the information from the .lnk file to find the executable.

Do you or anyone else know of such a program of script?

Thanks
Fhutt
 
I don't know of such a thing.

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top