title: CreateHardLink and CreateSymbolicLink Win32 Functions
body: <p>I am completing a project to create dummy file systems for backup testing and need to develop a method of creating a Hardlinks and Softlinks within the structures.</p>
  
  <p>The CreateHardLink and CreateSymbolicLink functions in windows.h receive file location and names based upon the current working directory.</p>
  
  <p>The source code now changes directory, but those two functions do not successfully execute.</p>
  
  <pre><code> wstring hltarg;
   hltarg = L"sym";
   hltarg += ExistingFileName;
   CreateHardLinkW(hltarg.c_str(), ExistingFileName.c_str(), NULL)
  </code></pre>
  
  <p>where hltarg concatenates the existing file name to the end of sym.</p>
  
  <p>Because I moved my working directory to my target directory, neither of these strings contains a full path, but rather just the target file names.</p>
  
  <p>Any advice on a different route to take rather than changing current directory?</p>
  
  <p>The application will need to be portable so no hard references to file paths can be made, although desired file paths will be provided.</p>