Re: Exec a program on Windows that contains ( ) in the filename



Hi Daniel,


Daniel writes:

exec c:/Tcl/bin/a\(b\)/test.bat
'c:\Tcl\bin\a' is not recognized as an internal or external command,
operable program or batch file.

[...]

From the Windows command line:

C:\Documents and Settings\user\Desktop>c:\Tcl\bin\a(b)\test.bat
'c:\Tcl\bin\a' is not recognized as an internal or external command,
operable program or batch file.

But if we quote it:

C:\Documents and Settings\user\Desktop>"c:\Tcl\bin\a(b)\test.bat"

C:\Documents and Settings\user\Desktop>echo Hello
Hello

In a previous discussion Cameron Laird suggested to use [exec <<] as
in:

exec $::env(COMSPEC) << {"c:\Tcl\bin\a(b)\test.bat"}

Of course in real applications you want to construct the string
dynamically. The main point is that if you can make CMD.EXE do what
you want, than you can use that facility from Tcl by piping the exact
syntax into CMD.EXE.


benny
.



Relevant Pages

  • RE: Error in Event Viewer - Active in HAT
    ... unfortunately I get this error when I start the trace. ... 'tracelog.exe' is not recognized as an internal or external command, ... operable program or batch file. ...
    (microsoft.public.biztalk.general)
  • Re: All DHCP Servers Info HELP!
    ... Recieved bunch of errors. ... ''' is not recognized as an internal or external command, ... operable program or batch file. ...
    (microsoft.public.windows.server.active_directory)
  • xcopy is not recognized as an internal or external command
    ... operable program or batch file. ... 'C:\xcopy' is not recognized as an internal or external command, ... Munging English.cfg ...
    (microsoft.public.windowsxp.general)
  • Re: Clock on pc time loss
    ... operable program or batch file. ... 'cmd' is not recognized as an internal or external command, ... The Windows Time service was stopped successfully. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Clock on pc time loss
    ... operable program or batch file. ... 'cmd' is not recognized as an internal or external command, ... The Windows Time service was stopped successfully. ...
    (microsoft.public.windowsxp.help_and_support)