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



Hi,

Have been banging my head on this. I have not found a way of executing
a file that has parentheses in its name on Windows.

Say the file is "test.bat" and it lives in "c:\Tcl\bin\a(b)". It
contains: echo Hello

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.

set f [open |c:/Tcl/bin/a(b)/test.bat] ; close $f
'c:\Tcl\bin\a' is not recognized as an internal or external command,
operable program or batch file.

set f [open |"c:/Tcl/bin/a(b)/test.bat"]; close $f
'c:\Tcl\bin\a' is not recognized as an internal or external command,
operable program or batch file.

exec {"c:/Tcl/bin/a(b)/test.bat"}
couldn't execute ""c:\Tcl\bin\a(b)\test.bat"": no such file or
directory

The weirdest of all:

cd c:/Tcl/bin/a(b)/
exec 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


Any ideas? I am going crazy over this. This comes in part from people
installing programs on c:\Program Files (x64) on 64bit versions of
Windows

Thanks in advance for any insight you can provide

Daniel

.



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)
  • Re: Clock on pc time loss
    ... Time loss with a fresh battery will be very small (a few milliseconds ... Ken Blake - Microsoft MVP Windows: ... operable program or batch file. ... 'cmd' is not recognized as an internal or external command, ...
    (microsoft.public.windowsxp.help_and_support)
  • 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)