title: Is there a workaround for CreateProcessWithTokenW's cmdline argument's max length?
body: <p>I'm trying to create an unelevated process from an elevated process on Windows 7-10.</p>
  
  <p>I used the following as a reference:</p>
  
  <p><a href="https://blogs.msdn.microsoft.com/aaron_margosis/2009/06/06/faq-how-do-i-start-a-program-as-the-desktop-user-from-an-elevated-app/" rel="nofollow noreferrer">FAQ: How do I start a program as the desktop user from an elevated app?</a></p>
  
  <p>Now, this method works wonderfully, however due to a possible legacy check, it seems that <code>CreateProcessWithTokenW()</code> only allows the <code>cmdline</code> argument to be less than or equal to 1024 characters. </p>
  
  <p>The <code>cmdline</code> I'm required to pass through is far more than that, which causes an <code>E_INVALIDARG</code> error. </p>
  
  <p>Has anyone run into the same issue as me?  If so, how did you work around this absolutely ridiculous 1024 character limit?</p>