I'm literally begging for help here. I have a program that as part of other things, executes a batch file. In visual studio 2008,it works fine either either as debug or release. If I execute it fro the debug/release directories it works fine. if I copy the debug/release directory somewhere else, sdProc.Start() will not execute.
I'm copying it on the same drive. If I move the whole VS project directory it works. I just cant move the debug dir on it's own.
Any help appreciated. I'm just not able to debug the problem.
Re: problem excuting process in different directory
The bat file is never executed as the program in the .bat file would write to a log and show up on screen. everything else is fine. I cant catch any errors, even the lowest 'Exception' but I think there might be an 'InvalidOperationException', even though I cant catch it. I see this when I hover over the proc object while debugging.
Re: problem excuting process in different directory
I am so mad at myself for not thinking of that!! The batch file was calling my .net exe which wrote new batch files. I added stderr to that and found the error straight away!
I added a streamwriter line to add
"cd\\"
to the beginning of the batch file and now it works!
(I know you are all wondering why the cmd.exe and batch files... the exe is also calling an old cobol app and it just wont execute properly any other way. it flatly dies if executed from powershell)
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.