title: Cygwin: launch bat with parameter, in new window, with explorer environment
body: <p>I need to run some .bat files from Cygwin. Until now, these bat files didn't required any param, so I used the following method:</p>
  
  <pre><code>     chmod +x $strBatFilename
       cygstart "$WINDIR/explorer.exe" "$strBatFilename"
  </code></pre>
  
  <p>These commands implement 2 features that I need:</p>
  
  <ol>
  <li>The .bat file is opened in a new window</li>
  <li><p>The environment of the new window is the explorer's one, not the one of Cygwin</p>
  
  <p>The problem that I have is that now I need to also pass a parameter to the bat file.
  I don't know of a method to call explorer.exe with a file (my bat) as parameter and having some extra option to pass another parameter to the bat (sounds like passing a parameter to a parameter of explorer.exe).</p>
  
  <p>I have searched and found that I can start a cmd.exe. I tried starting it directly or starting it using cygstart:</p></li>
  </ol>
  
  <p>cygstart $WINDIR/system32/cmd.exe /c start "$strBatFilename $strBatParam"</p>
  
  <p>I have managed to make it start in a new window and launch the .bat with a parameter, but the environment is not the explorer's one.</p>
  
  <p>I don't know the exact differences between the two environments. What makes me say they are different is that when for example the bat contains a repo sync command, if it's open with explorer it runs the repo sync command smoothly, while if the bat is called from cmd.exe, the repo sync command will ask for my user name and email. </p>
  
  <p>So, my question is: are you aware of any command that will start from Cygwin a .bat file</p>
  
  <ol>
  <li>passing a parameter to it</li>
  <li>opening it in a new window</li>
  <li><p>having the new window inherit the explorer's environment ?</p>
  
  <p>Thank you</p></li>
  </ol>