Catered for edge case where user leaves trailing forwardslash or backslash in path and appcmd borks.