Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

args not passed to .tcl script in batch file

Skip to first unread message

rick h

unread,
May 8, 2012, 10:39:00 AM5/8/12
to
Have tcl scripts in .bat files that expect arguments. Works fine in
XP. When run in win7, the script does not receive the values passed as
parameters.

Net: argc is 0; argv is empty.

Have taken UAC to lowest level. Have changed the properties to enable,
read, write, execute, etc.

All scripts are in c:\program files (x86)\star.

e.g
runtranslator.bat contains the following
shell-translatorTCL.bat "/Star/sims/source_scenarios/IF_test.ssc"

shell-translatorTCL.bar contains the following
cd \Star\SIDE\sp_translator
sdd_scripttranslator.tcl %1 %2 %3 %4 %5 %6 %7 %8 %9

arjenmarkus

unread,
May 8, 2012, 10:53:38 AM5/8/12
to
I see that you rely on the associations. What happens if you change the
line to:

tclsh sdd_scripttranslator.tcl %1 %2 %3 %4 %5 %6 %7 %8 %9

?

Regards,

Arjen

rick h

unread,
May 8, 2012, 1:52:13 PM5/8/12
to arjen.m...@gmail.com
Also, the tcl directory is in the OS environment 'path' and extensions records.

rick h

unread,
May 8, 2012, 1:56:41 PM5/8/12
to arjen.m...@gmail.com
Just put a ref to c:\program files (x86)\tcl\bin in the environment and it seems to be working...at least it is being invoked...


Thanks,

rick h

unread,
May 8, 2012, 1:51:14 PM5/8/12
to arjen.m...@gmail.com
On Tuesday, May 8, 2012 10:53:38 AM UTC-4, Arjen Markus wrote:
tclsh.exe is not recognized as an internal or external command ... or operable program or batch file...

rick h

unread,
May 8, 2012, 2:47:42 PM5/8/12
to arjen.m...@gmail.com
One last thought (question): why, using references, was the script initiated, but no parms passed?

rick h

unread,
May 8, 2012, 2:48:48 PM5/8/12
to arjen.m...@gmail.com

Andreas Leitgeb

unread,
May 8, 2012, 6:49:31 PM5/8/12
to
rick h <ri...@advertech-ltd.com> wrote:
> One last thought (question): why, using references, was the script initiated, but no parms passed?

Probably, because the "open"-binding for extension .tcl specifies
tclsh.exe(with correct path) but no parameters.

Arjen Markus

unread,
May 9, 2012, 8:01:53 AM5/9/12
to a...@logic.at
Op woensdag 9 mei 2012 00:49:31 UTC+2 schreef Andreas Leitgeb het volgende:
> rick h wrote:
> > One last thought (question): why, using references, was the script initiated, but no parms passed?
>
> Probably, because the "open"-binding for extension .tcl specifies
> tclsh.exe(with correct path) but no parameters.

I have checked the association for .tcl files on my system:
assoc .tcl
.tcl=ActiveTclScript

Apparently the definition of "ActiveTclScript" is: c:\tcl86\bin\wish86.exe "%1" %*
(That is the information I get from the file manage I use. I have no clue as
to how to set that, but it is probably stored in the Windows registry)

The point is: with "%1" wish86 gets the file name, with %* it probably gets all
the other command-line parameters as well.

Regards,

Arjen
0 new messages