Page 1 of 1

Windows 10: Batch-triggered first run of TC fails

Posted: Fri Nov 16, 2018 12:32 pm
by loonquawl
I'm currently experimenting with executing Testcases that test the before and after of a Reboot-Situation. I use a Solution that has two Testcases, Before and After. The Before Testcase does some things, and then triggers a forced Reboot (via
System.Diagnostics.Process.Start("shutdown.exe", -r -f -t " + argument1);

(the argument is a time in seconds)). This works well. I then use a batch script in the autostart Folder of windows 10 ("Startup") to start the Testcase After:
START "Ranorex-Cmd" /D C:\PathtoTest\X\bin\Debug /B X.exe /tc:AfterBoot 
Now to the weird part: If i run this batch script for the first time after a reboot, it fails to execute. It does not matter whether it started manually, or by Autostart. First Run = Fail. If i then start it again, it runs fine. It fails with errorcode 0xc0000142

Has anybody had similar problems? I imagine it has something to do with permissions, but i'm lost as to what i could do. (My current workaround is to run the same start command twice in the Batch File, but that seems like an ugly hack.

Re: Windows 10: Batch-triggered first run of TC fails

Posted: Fri Nov 16, 2018 2:21 pm
by odklizec
Hi,

It sounds to me like a windows-related problem and not something Ranorex-related? Have you tried to run your test on another PC (including win restart)?

Re: Windows 10: Batch-triggered first run of TC fails

Posted: Tue Nov 20, 2018 12:26 pm
by loonquawl
It is most certainly a Windows problem, but i was hoping that someone had encountered (and countered) it with Ranorex already - the Problem of errorcode 0xc0000142 is widely known all over the net, but the remedies seem to be very specific to the circumstances and tools that trigger it.

Re: Windows 10: Batch-triggered first run of TC fails

Posted: Tue Nov 20, 2018 2:11 pm
by odklizec
Hi,

A quick search revealed few old posts, discussing this issue. Check for example this post, with possible solution of the issue:
getting-an-error-related-to-exe-while-r ... tml#p30432
Or this one:
viewtopic.php?f=9&t=8277&p=33507#p33507