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.