I have tfs local server. I write unit test , that execute batch file. The problem is: when I manual execute batch file it's perfect work. But when this script execute programmatically (check-in unit test and build definition. Test starts on build server by unknown credential) I see half result. So. How can visual studio (use c#) starts batch file, use credential of another user?
Asked
Active
Viewed 1,480 times
2 Answers
0
If I understand the issue you have, I'd recommend using runas. So it will be something like:
runas.exe /profile /user:YOURDOMAIN\YourUser %yourpath%\yourbatch.bat
You can set this to VS to run, instead your batch.Hope this helps!
-
runas need manual password. But I need do this automatically. – user3231442 Apr 03 '14 at 15:18
-
@user3231442 "/savecred" param, if you happen to read the technet link in my answer – Apr 04 '14 at 07:43
-
*Enter the user's password only when prompted* – Kiquenet Jul 14 '19 at 05:14