I'm trying to run process via powershell script on windows startup. Unforturnately, PC on which I running it is slow. In most of cases the Start-Process method "crashes" with message This command cannot be executed due to the error: The service did not respond to the start or control request in a timely fashion
. Is there a way, to adjust this timeout or do something, to solve this problem?
Line on which this issue appears:
Start-Process $AppPath -Credential $credential -WorkingDirectory $InstalationPath
EDIT: I tried also to set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ServicesPipeTimeout
and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\WaitToKillServiceTimeout
to some big values (up to 1200000), but it doesn't help.