I'm trying to write a simple .bat file which will compile a series of input shader .fx files and write the compiled output files as .obj files. The bat file works except for one thing: I can't see how to add the extension .obj to the output file names. For example an input file "myShader.fx" gets compiled and saved as "myShader".
Here's what I have so far (I'm using the DirectX shader compiler fxc.exe):
@echo off
for %%X in (*.fx) do (
echo.%%X
fxc %%X /LD /T fx_2_0 /Fo
)
pause
If I use the compiler for a single file then the following does what I want:
fxc myShader.fx /LD /T fx_2_0 /Fo myShader.obj
I was hoping to use simple string manipulations on the string %%X in the for/do loop to produce the desired output name but can't seem to get it to work as desired.
It's been over 25 years since I last wrote a .bat file so I'm a bit rusty - and I guess a few things have changed since then

.
Any suggestions?