I have .bat file which works with network path using directory stack and therefore needs network privileges. My PC is member of domain. And here is strange thing: when I run batch file using double click on it - it works. If I will choose "Run as diffrent user" and enter my credentials such as DOMAIN\USER
and password - this batch file works not properly. Therefore question - under which user batch file is executed when clicked? UAC is turned off I believe.
EDIT
here's batch script:
for /r %%F in (Output_AutomatedBuild\TestsResults\Coverage\*.cover.xml) do (%
xslt2xml.exe ncover2newncover.xsl %%F %%F
)
here's C# source code of xslt2xml.exe program:
class Program
{
static void Main(string[] args)
{
try
{
XslTransform myXslTransform;
myXslTransform = new XslTransform();
myXslTransform.Load(args[0]);
myXslTransform.Transform(args[1], args[2]);
}
catch(Exception ex)
{
Console.WriteLine("Exception:");
Console.WriteLine(ex);
}
}
}
As you can see exception won't be thrown so exit code always be equal to zero.