static extern bool PathRemoveFileSpec([In,Out] StringBuilder pszPath);
Declare Function PathRemoveFileSpec Lib "shlwapi.dll" (TODO) As TODO
bool bRet = PathRemoveFileSpec(str);