title: How to find file path after installation of a C# program?
body: <p>I have a problem with finding the file after my program installation on another computer. I'm using C# and this is a part of my code:</p>
  <pre><code>// template path
  string tmpPath = @&quot;|DataDirectory|\Templete.docx&quot;;
  
  // output path
  string outputName = @&quot;|DataDirectory|\Output.pdf&quot;;
  
  // shadow file name
  string shadowFile = @&quot;|DataDirectory|\temp.docx&quot;;
  
  // Create shadow File
  File.Copy(tmpPath, shadowFile, true);
  
  // open word
  word.Application app = new word.Application();
  Document doc = app.Documents.Open(shadowFile);
  </code></pre>
  <p>I use<code>&quot;|DataDirectory|&quot;</code>, it worked for finding the database but here I use it again to find my word file and it throws me this error:</p>
  <blockquote>
  <p>System.ArgumentException: 'Illegal characters in path.'</p>
  </blockquote>