improved shares command, added preventive check to identify a writable share and use it for upcoming commands when needed