Windows 10: Batch-triggered first run of TC fails
Posted: Fri Nov 16, 2018 12:32 pm
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
(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:
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.
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:AfterBootNow 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.