Brian,

No, I had not tried that before you told me to do so ...

I did do that in my TCL program and now I don't get the error ('File name' is not recognized as an internal or external command, operable program or batch file), and the shortcut runs the ".exe" file. Thanks for helping me get rid of the error I was getting, however, the results are NOT what I want. The resulting window has the attributes of the ".exe" file and NOT the shortcut.

I have attached two files to this email as an example of what I am trying to do ...

1) junk.exe - a very simple compiled "c" program

2) Shortcut_to_junk - shortcut to the executable

When you double click file 1) a window comes up with white text on a black background.

When you double click file 2) a window comes up with red text on a yellow background.

In my sample TCL program I now have :

a) exec cmd.exe /c junk.exe &

b) exec cmd.exe /c Shortcut_to_junk.lnk &

Both a) and b) launch a window with white text on a black background. I want b) to act like 2) ... meaning I expected to get a window with red text on a yellow background, however, I get a window with white text on a black background ... which is 1) and NOT 2).

How can I get the shortcut attributes rather than the attributes of the ".exe" file of the window that is launched by b) in my TCL program???

TIA,

Mark

Brian Griffin <bgriffin@model.com>
10/02/2003 05:01 PM MST

To: Mark A Jarmus <majarmus@raytheon.com>
cc: tcl-win@lists.sourceforge.net
bcc:
Subject: Re: [WINTCL] cmd.exe error


Have you tried:

?
-Brian

Mark A Jarmus wrote:

>
>
>
>All,
>
>I am working on a PC WINDOWS system (OS WIN 2000) and trying to exec a
>shortcut to an executable file from my TCL program. I get the following
>error :
>
>'File name' is not recognized as an internal or external command, operable
>program or batch file
>
>The executable that I am trying to run was given to me by someone else (I
>don't have control of the source code to the executable I am trying to run)
>which I am running within my TCL application. If I exec the executable file
>within my TCL program it runs fine, however I have created a shortcut to
>the executable so that I can control various attibutes (foreground color,
>background color, width of window, height of window, etc.) of the window
>that is launched when the executable is running.
>
>1) exec cmd.exe /k my_file.exe &
>or
>2) exec cmd.exe /c my_file.exe &
>
>When I run either of the above two commands from the console and from
>within my TCL program, both of these launch the executable file (namely,
>"my_file.exe") in the background, however, I can't preset the attributes of
>the window that appears before it appears on the CRT ... which is something
>I want to do.
>
>A) exec cmd.exe /c shortcut_to_my_file &
>
>When I run the above command from the console I get the error message I
>listed above (namely, 'File name' is not recognized as an internal or
>external command, operable program or batch file). When I run the above
>command from within my TCL program ... nothing "appears" to happen ...
>meaning ... I don't get any TCL error messages and I don't see the window
>appear on the CRT as I do when I run from the console.
>
>
>Can anyone tell me how I can call or execute a "SHORTCUT" to an executable
>from within my TCL program???
>
>Any help you can provide will be greatly appreciated.
>
>TIA,
>Mark
>
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:ThinkGeek
>Welcome to geek heaven.
>http://thinkgeek.com/sf
>_______________________________________________
>Tcl-win mailing list
>Tcl-win@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/tcl-win
>
>
>

--
-------------------------------------------------------------
--                 Model Technology Inc.                   --
-- 8005 SW Boeckman Road                  503.685.7000 tel --
-- Wilsonville, OR 97070 USA              503.685.0921 fax --
-------------------------------------------------------------
-- Technical support ............ mailto:support@model.com --
-- Sales and marketing info ....... mailto:sales@model.com --
-- Licensing .................... mailto:license@model.com --
-- Home Page ........................ http://www.model.com --
-- AIM ........................................ bgriffin42 --
-------------------------------------------------------------