Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NAnt: executing NCover as administrator account - runas returns directly without waiting

My NAnt build runs as a non-admin as part of CruiseControl. But we have an NCover task which needs to run as an Administrator. For this we are thinking about using RunAs with an admin account.

The problem is that RunAs returns directly and doesn't wait for the process to exit.

Is there a way to block the NAnt build until NCover has finished?

Tnx

like image 636
Dries Van Hansewijck Avatar asked Jul 12 '10 10:07

Dries Van Hansewijck


1 Answers

So far I have found that using psexec works for this. The command I am using is:

psexec -w directory file_to_run -u myusername

With an optional -p password

The one concern I have is that psexec's EULA appears to forbid what I want to use it for. But I am not sure. The phrase I am worried about is:

You may not:

  • transfer the software or this agreement to any third party;

I want to replace the runas usage in our installer with psexec. Psexec would be on a cd, and I could just run it from there, or make a copy and delete it when I am done.

Would these uses violate this agreement?

like image 55
Nick Knowlson Avatar answered Sep 22 '22 22:09

Nick Knowlson