title: how do I define the path when running a Rake task with system command from another Rake task
body: <p>So, I have a rake task that runs as a chron task (its running on windows so this is rufus scheduler instead), this particular rake task sends data via HTTP to a server. If a specifically defined error is sent back in the HTTP response body another rake task is ran with the <code>system</code> command.</p>
  
  <p>Unfortunately this is ran on windows. the rake task is connecting to a database and sending data while each row in the DB is being read so the following error is being thrown, so its saying the "above path" is the current directory, and it doesnt see the rake task as an available command</p>
  
  <pre><code>C:\Users\ALilland\Documents\macros\experiments\core_scripts\app&gt;rake sage_time_records:import
  '\\SAGE\TIMBERLINE OFFICE\9.5\ACCOUNTING\GLOBAL'
  CMD.EXE was started with the above path as the current directory.
  UNC paths are not supported.  Defaulting to Windows directory.
  rake aborted!
  No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
  
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>Rake Task</p>
  
  <pre><code>task :import do
    ## establish connection
    # ...
  
    ## Print out each row
    while row = db_query.fetch do
      # ...
  
      ## define the payload of what will be sent to API
      # ...
  
      begin
        url = "#{ENV['API']}/time_records"
        print "Sending Time Record to API ... "
        response = RestClient.post(url, payload, {accept: :json})
        puts 'success' if response.code == 201
      rescue RestClient::ExceptionWithResponse =&gt; error
        puts 'failed' if error.response.code != 201
        error_body = JSON.parse(error.response.body)
        next if error_body['error'] == 'Job Number not found'
  
        ## calling the other rake task and passing a variable
        system("rake sage_field_employees:import[\"#{mapped[:employee]}\"]") if error_body['error'] == 'Field Employee not found'
        # ...
      end
  
    end
    # ...
  end
  </code></pre>