Sorry if this appears to highjack your thread, it is related and I spent hours trying to get the advice posted here to work with my Raspberry Pi before I gave up and came up with this alternative for the Raspberry Pi users out there....note that this should also work on Ubuntu 18.04.
I tried to get the above advice to work with Raspberry Pi Raspbian buster desktop on my Raspberry Pi 3+, but all I could get to work reliably was the command line version posted by user6354 at the beginning of this thread. However, I was able to place that line with a little editing into a file in the /home/user/.config/autostart folder on my pi and got it to work.
The contents of the file should look like the following (make changes for your situation - see below):
Comment=Script to mount OurCloud_share
Exec=lxterminal -e "sudo mount.cifs //192.168.1.xxx/sourcefolder /home/pi/targetfolder -o username=loginID,password=userpassword"
OurCloud_share = whatever you want to call your NAS drive access
192.168.1.xxx = replace this with your NAS TCP/IP address on the network
sourcefolder = shared folder on your NAS drive
targetfolder = the folder where you want the mounted NAS folder contents to appear (Create this folder and ensure you make it read/write if you want two way access to it)
loginID = the user ID for logging in to your NAS via network
userpassword = the password to use with the loginID
Name the file something meaningful (here I use "mount_OurCloud.desktop". The ".desktop" file type is required.)
Save this and then use root authority to set the file permission for executable.
Reboot and your NAS folder should be visible in the target folder.