Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Runas" in Ant script

I have an application which needs to run with different user name.

I am trying to call "runas.exe" to call the batch file which calls my application.

When I tried this in command prompt it worked fine. One drawback is I have to provide password

I am wondering if this is possible as this runs on build sever without anyone intervention

Here http://blogs.msdn.com/b/oldnewthing/archive/2004/11/29/271551.aspx Microsoft explains why we cannot give password as command line parameter

I don't know what could be the better approach. Can anyone suggest any good alternative

I use Windows 2008 R2 64 bit

like image 490
KK99 Avatar asked Dec 21 '25 07:12

KK99


1 Answers

You can't do this, unless you write a small program which does this for you. Batch won't cut it for obvious security reasons.

A sample program that will work in windows xp can be found here.

like image 182
FailedDev Avatar answered Dec 22 '25 22:12

FailedDev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!