I have a site that using asp.net and I am trying to create a batch script and run it.
I am using it to get latest files for a tfs workspace
the .bat only has
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
tf get "workspacePath" /force /recursive
when I run this on the remote server by clicking on the .bat itself, it works fine and does everything I need it to do.
When I try to use this through the site it does not work.
I confirmed it does read and attempt to execute the script by adding a random .txt file in the location of the bat and have the script delete it, which worked through the site.
I have many times run batch scripts through my site, but for this specific example it is not working.
I have tried executing it via...
Process.Start(@"filepath\getStuff.bat");
I have also tried just bypassing the batch script by using psExec
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = @"path\PsExec.exe";
p.StartInfo.Arguments = @"\\vdvws052 ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\TF.exe"" get ""workspacePath"" /force /recursive";
p.Start();
With each way I have tried I have also added a .WaitForExit()
incase that was the issue, but that didn't help either