On 05/18/17 13:33, Stefan Dösinger wrote: > + WideCharToMultiByte(CP_ACP, 0, target_w, -1, target, wcslen(target_w) + 1, NULL, NULL); You can use MAX_PATH here instead of wcslen(target_w)+1. Thanks, Piotr