Batch file acts strangely

May 20, 2008
11,546
104
Syracuse, NY, USA
Here's a batch file I use from within DevEnv (long "dumpbin" lines may be wrapped).

window min
echo -
iff "%2" == "both" then
echos Before: Size: %@filesize[%1.prev]` `
dumpbin /headers %1.prev | egrep "virtual size|^ *\." | sed -e 's/virtual size//g' | sed -e 's/ name.*//g' | crunch
echos ^r^nAfter:` `
endiff
echos Size: %@filesize[%1]` `
dumpbin /headers %1 | egrep "virtual size|^ *\." | sed -e 's/virtual size//g' | sed -e 's/ name.*//g' | crunch
copy /q %1 %1.prev

When I run it from a DevEnv "external tool" with

Command: d:\tcmd9\tcc.exe
Params: /c u:\postbuild.bat $(TargetPath)

it bombs thus:

Size: 12288 TCC: U:\postbuild.bat [9] Unknown command "^ *\. | sed -e 's/virtual size//g' | sed -e 's/ name.*//g' | crunch"
TCC: (Sys) U:\postbuild.bat [10] The system cannot find the file specified.
"G:\Projects\plugsample\release\qbat.dll g"

If I give it a superfluous parameter,

Params: /c u:\postbuild.bat $(TargetPath) foo

it runs OK, producing the expected output:

Size: 12288 .text 17ED .rdata DCC .data 4104 .rsrc 1D8 .reloc 3D8

Any idea what's going on?
 
Similar threads
Thread starter Title Forum Replies Date
vefatica `Back quotes` - command line vs. batch file Support 5
fpefpe How to? batch file size Support 2
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
P Kill all other instances of tcc from a btm batch file Support 2
fpefpe batch file ending early Support 18
K robocopy cancelling batch file processing Support 28
A Unable to pass batch file arguments unaltered Support 18
MickeyF Why does this batch file give me 'unknown command "else"' error? Support 17
cxxl Set encoding for batch file Support 4
dcantor How to? Batch file to be executed by TCSTART Support 4
D Alias in batch file Support 3
TT's Help! Uninstalling TCC did not restore cmd.exe as Win10 default batch file processor. Support 4
vefatica Exit code of a batch file? Support 4
J cd command altered in batch file Support 3
MickeyF running a program from cmdline versus in batch file Support 1
B Batch file won't run if there is already an instance of TC 17 running Support 9
nickles Fixed Executing long command lines in a batch generates file name errors Support 16
C How to? run a batch file in administrator mode while debugging in take command software Support 1
cgunhouse Fixed bdebugger with not exist batch file causes a crash Support 2
Mezlo menu batch file questions Support 25
F Minimising the command window running from a batch file Support 19
S How to? Batch file problem Support 67
S How to? Incorporate tables from HELP into batch file Support 15
S Fixed TC crashes with a certain batch file Support 6
R How to? debug a nested batch file Support 2
M How to? Save the session log from a batch file? Support 5
S Documentation Topic: Batch File Parameters Support 14
M How to? A very simple question re. the current line number in a batch file... Support 2
Stefano Piccardi IDE unexpectedly exits inside this batch file Support 17
epement Strawberry Perl batch file errors Support 15
B Bdebugger doesn't recognize breakpoint after batch file returns Support 2
E Batch file pauses for no reason Support 16
B Start and keystack do not work in batch file Support 1
B Bdebugger / IDE editor doesn't display called batch file Support 1
M Running a batch file at Windows startup... Support 8
nikbackm Alias - launch external program - batch file Support 16
nickles Using backticks in a batch file Support 8
MBaas GUI-Tool for "File/Open" or tree (for use in batch-files) Support 3
jcalcote Apache Maven startup batch file issues Support 3
deleyd command that launches batch file running TCMD? Support 6
S LOG within a batch file Support 1
D Some feedback on simple batch file Support 2
p.f.moore Equivalent of PRE_EXEC/POST_EXEC in a batch file Support 2
p.f.moore Running another batch file without CALL Support 7
H Configuring the location of BATCH.BCP in the INI file Support 0
fpefpe How to? shortcuts and batch files Support 4
M Oracle batch OPatch.bat.bat not working in TCC but correctly in CMD Support 5
R Batch Debugger Command Expansion Window Support 3
K Batch debugger not stepping correctly Support 4

Similar threads