title: Ensure Relative Path is Used in cmd.exe when Running Batch Files From Excel
body: <p>I have an Excel file with a button that calls a Shell command in VB:</p>
  
  <pre><code>Shell(ThisWorkbook.Path &amp; "\python_script.bat", vbNormalFocus)
  </code></pre>
  
  <p>The Shell command calls the above batch file that runs a Python script:</p>
  
  <pre><code>python python_script.py
  </code></pre>
  
  <p>All the pertinent files (the Excel file, the batch file, the data files, the Python file) are all located in the same directory, call this <code>sample_program</code>, because I am building this for someone else and I intend for them to simply unzip it and run it.</p>
  
  <p>In Excel, when testing this, I click the button and then get this error:</p>
  
  <pre><code>C:\Users\&lt;user_name&gt;\Documents&gt;python python_script.py
  python: can't open file 'python_script.py': [Errno 2] No such file or directory
  </code></pre>
  
  <p>For some reason, although all these files are in the same location, the cmd.exe is running from my user directory: <code>C:\Users\&lt;user_name&gt;\Documents</code></p>
  
  <p>I don't want cmd.exe to use this path; I want it to use the <code>path\to\sample_program</code> directory.</p>
  
  <p>How do I get this to use relative paths so when I transfer this folder to someone else, and they place it anywhere, it will work as a self-contained unit?</p>