title: Could not find a part of path error on server
body: <p>I want to run a scheduler on daily basis. So I have created a <code>Windows application</code> and stored it onto the server.</p>
  <p>This works fine on my local machine, but I get path error as</p>
  <blockquote>
  <p>Could not find a part of path</p>
  <p>C\Windows\System32..</p>
  </blockquote>
  <p>With this, I think there might be some issue related to the path.</p>
  <p>Here is my code for that.</p>
  <pre><code>startupPath = Environment.CurrentDirectory;
                      strExp = &quot;RAName = '&quot; + group.Key + &quot;'&quot;;
  
                      DataTable dtNew = ds.Tables[1].Select(strExp).CopyToDataTable();
                      DataSet dsNew = new DataSet();
                      dsNew.Tables.Add(dtNew);
  
                      dtNew.Columns.Remove(&quot;RAName&quot;);
                      dtNew.Columns.Remove(&quot;UserEmail&quot;);
                      ExcelLibrary.DataSetHelper.CreateWorkbook(startupPath + &quot;\\Attachment\\Reminder_Sheet_ &quot; + dtNew.Rows[0][&quot;SR NO&quot;].ToString() + &quot;.xls&quot;, dsNew);
  
                      ls_attach1.Add(startupPath + &quot;\\Attachment\\Reminder_Sheet_ &quot; + dtNew.Rows[0][&quot;SR NO&quot;].ToString() + &quot;.xls&quot;);
  
                      foreach (var attach in ls_attach1)
                      {
                          mail.Attachments.Add(new Attachment(attach));
                      }
  
                      ce.SendEmail(tb_RA.Rows[0][&quot;RA1_Email&quot;].ToString(), &quot;&quot;, &quot;&quot;, &quot;Information on documents for processing&quot;, sbodyMail,
                                                          &quot;AUTOSQL&quot;, &quot;Powersoft&quot;, ls_attach1, &quot;ConnectionString&quot;);
                      foreach (Attachment attachments in mail.Attachments)
                      {
                          attachments.Dispose();
                      }
  
                      if ((System.IO.File.Exists(startupPath + &quot;\\Attachment\\Reminder_Sheet_ &quot; + dtNew.Rows[0][&quot;SR NO&quot;].ToString() + &quot;.xls&quot;)))
                      {
                          System.IO.File.Delete(startupPath + &quot;\\Attachment\\Reminder_Sheet_ &quot; + dtNew.Rows[0][&quot;SR NO&quot;].ToString() + &quot;.xls&quot;);
                      }
   
  </code></pre>
  <p>I don't know what's wrong with the path here,</p>
  <p>Here is the screenshot of the error</p>
  <p>[![Error][1]][1]</p>