title: "The system cannot find the file specified." when running ECS Fargate task
body: <p>I am trying to run a Fargate (Windows) task on AWS ECS but it fails as soon as it ends it's &quot;PENDING&quot; state. I am not sure what I am missing. There is only 1 possible file that could cause this - <code>Wait-Service.ps1</code> but I don't see why it shouldn't be found.</p>
  <p>The <code>Wait-Service.ps1</code> file is located in <code>bin/Debug</code> folder.</p>
  <p>This is my <code>Dockerfile</code>:</p>
  <pre><code># escape=\
  
  FROM mcr.microsoft.com/windows/servercore:ltsc2019
  
  SHELL [&quot;powershell&quot;, &quot;-Command&quot;, &quot;$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';&quot;]
  
  RUN &quot;mkdir C:\temp&quot;
  
  WORKDIR &quot;C:/service&quot;
  
  COPY bin/Debug/ .
  
  RUN &quot;C:/Windows/Microsoft.NET/Framework64/v4.0.30319/installutil.exe&quot; /LogToConsole=true /ShowCallStack ./SprProductionDataService.exe; \
    Set-Service -Name &quot;\&quot;SprProductionDataService\&quot;&quot; -StartupType Automatic; 
  
  #The container stays up as long as this process is running.
  CMD &quot;C:/service/Wait-Service.ps1&quot; -ServiceName &quot;SprProductionDataService&quot; -StartupTimeout 10 -AllowServiceRestart;
  </code></pre>
  <p>I only see this error message (in the AWS Console):</p>
  <pre><code>Status reason   CannotStartContainerError: CannotStartContainerError: 
  hcs::System::CreateProcess 5d85964e54844ae0ad18140057019deb-4109322994: 
  The system cannot find the file specified.: unknown
  </code></pre>
  <p><strong>UPDATE</strong>:</p>
  <p>I tried to run the container pulling it from the ECR repo and it does fail as well:</p>
  <pre><code>PS D:\_Code\SPRProductionDataService\SprProductionDataService&gt; docker run --name sprprod -it spr-production-service-dev-ecr:latest 208555724522.dkr.ecr.us-west-2.amazonaws.com/spr-production-service-dev-ecr:latest powershell
  docker: Error response from daemon: container e1658203aca736881659e1a5445e8d0ec549ccf94fe2f2952012752e330d9826 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2)
  [Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
  [Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
  [Event Detail: onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(173)\vmcomputeagent.exe!00007FF7FACA9F4B: (caller: 00007FF7FAC5E13A) Exception(2) tid(3a4) 80070002 The system cannot find the file specified.
      CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess]
   Provider: 00000000-0000-0000-0000-000000000000].
  </code></pre>