!macro MakeUnicodePathWithSpecialChar outvar prefix unicodechar suffix push $0 push $1 StrLen $0 '${prefix}' StrLen $1 '${suffix}' IntOp $0 $0 * 2 IntOp $1 $1 + 1 ;\0 IntOp $1 $1 * 2 System::Call /NoUnload "*(&w$0 '${prefix}',&i2 0xFF0F, &w$1 '${suffix}')i.s" Exch 2 pop $0 pop $1 pop ${outvar} !macroend Section Required SectionIn RO SetOutPath - !define BasePath "D:\unsorted\dev" !insertmacro MakeUnicodePathWithSpecialChar $0 "\\?\${BasePath}\foo" 0xFF0F "bar" System::Call /NoUnload "kernel32::CreateDirectoryW(i$0,i0)" System::Call /NoUnload 'user32::MessageBoxW(i $hwndparent,i $0,w "Will now delete:",i0)' System::Call /NoUnload "kernel32::RemoveDirectoryW(i $0 )" System::Free $0 SectionEnd