Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
It's run with the user-credentials you're typing in. But, it also highly depends on what the script is doing. –  Vanadis Jul 5 '13 at 10:49
    
@Vanadis OP asks for the credentials used when running from double-click. –  gronostaj Jul 5 '13 at 10:55
    
@gronostaj I'm aware of this fact. The context under which the batch-file is running, is the same as the credentials, but it's possible to run certain functions in the script as a different user, for example if he's running a 3rd-party-executable. –  Vanadis Jul 5 '13 at 11:00
    
@Vanadis I will post script in few minutes –  seeker Jul 5 '13 at 11:16
2  
Are you sure your problem is related to permissions and not simply paths? (i.e. try using an absolute path) –  Mat Jul 5 '13 at 11:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.