http://bugs.winehq.org/show_bug.cgi?id=33189
--- Comment #8 from Jason Edmeades us@edmeades.me.uk 2013-03-14 17:01:17 CDT --- Ok, so there's two related issues here. The first is that attempting to run a batch program with a parenthesis in the name causes an infinte loop, the next is how do you run it e.g. through wineconsole.
The root cause of the infinite loop is a patch we needed back in 2007 (added by me... http://www.winehq.org/pipermail/wine-patches/2007-April/037866.html ) because internal exe's did not have entries in the wine tree, hence could not be located (in that case, xcopy). This has long since been fixed so I believe all the 'assumeIntenal' code in wcmdmain is redundant. However in this case, wine 'cleverly' now parses the filename into test, locates it and cannot find it, then has one last attempt by spawning "cmd.exe /c test(123).bat", getting into its loop.
I believe the right answer is to delete all the assumeInternal code - if it isnt found, it isnt there! I am slightly nervous about removing this just in case there's any scenario I have missed, but certainly the reason it was added is no longer a problem.
If you build from source, change line 1176, the assignment of assumeInternal, to false, ie on the line following "WINE_TRACE("ASSUMING INTERNAL\n");" change to "assumeInternal = FALSE;"
This removes the infinite loop, but does not solve the wineconsole issue - ie I think the core cmd.exe then is correct but leaves your question. Let me have a play