this question should be relatively simple and shouldnt even require much explanation i dont think, here goes:
my website is executing a batch file using the Process object which requires a path to the .bat file of course
i will be housing my site on multiple servers therefore i dont want to give an absolute path i want to just use a relative path within my project (for example use the scripts folder automatically generated by visual studio when i made my project)
i just am not sure exactly how to reference that file within the code once its in the scripts folder.
here is my current code for referencing my .bat:
p.StartInfo.WorkingDirectory = "C:\\Users\\e\\Desktop\\Test_Bat_Thing";
p.StartInfo.FileName = "C:\\Users\\e\\Desktop\\Test_Bat_Thing\\test.bat";
which works perfectly. but i want it to be something along the lines of
p.StartInfo.WorkingDirectory = ".\\scripts";
p.StartInfo.FileName = ".\\scripts\\test.bat";
please help! thanks in advance 🙂
Try something like the following: