On Visual Studio (2015 and 2017) I have a batch file that I run on AfterBuild.
<Target Name="AfterBuild">
<Exec Command=""$(ProjectDir)\test.bat"" WorkingDirectory="$(ProjectDir)" />
</Target>
Inside the batch file it is quite simple line
"%SYSTEMROOT%\System32\oscdimg.exe" -n -m "%~dp0.\bin" -l"testdisk" "%~dp0\test.iso"
When I run the batch file by itself (simple double click on bat file), it functions as desired.
However, when Visual Studio get to AfterBuild, following error shows up.
'"C:\WINDOWS\System32\oscdimg.exe"' is not recognized as an internal or external command, operable program or batch file.
Would anybody have clue as to why this is occuring? Is there restriction on visual studio AfterBuild? Even if I take the extra double quotation around oscdimg.exe (because there are no white spaces) the error does not go away.
Any help would be appreciated.
Thank you