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

2

9

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

Kamalakamaria answered 12/7, 2010 at 10:13 Comment(1)
I am having this problem too - trying to find a way to get runas to wait for the other command to finish executing. Did you ever solve this one?Giana
G
1

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?

Giana answered 30/11, 2010 at 17:2 Comment(0)
M
0

Does adding the /W option to runas get it to wait?

Myrwyn answered 22/7, 2010 at 0:1 Comment(3)
No, there is no option /W whatsoeverKamalakamaria
What version of Windows are you running on?Myrwyn
I am not the OP, but am running into this problem as well. I am running Windows XP and Server 2003Giana

© 2022 - 2024 — McMap. All rights reserved.