SHSetKnownFolderPath

[DllImport("shell32.dll", CharSet = CharSet.Unicode)]
public static extern int SHSetKnownFolderPath(
   ref Guid rfid,
   uint dwFlags,
   IntPtr hToken,
   string pszPath
);

Microsoft documentation: Link

Last updated