... your $PathOnly is in double quotes, so the backslashes there are interpreted as escape sequences.