Mount Windows Share Permanently

I am trying to get a permanent solution to this. I am trying to access my Windows share from the Le Potato. If I manually enter the following:
sudo mount // /home/tom/ShareFile -t cifs -o username=XXX,password=YYY
I can mount the share but only for that session. I have tried working with /etc/fstab but have failed every time.
How do I make this a permanent mount? Oddly, I can see the Potato share file in Windows.

Thank you.

You need _netdev so that it tries the mount after network is brought up.

Perhaps I need to clarify. I would like this to be an automated process. I have to enter sudo mount // /home/tom/ShareFile -t cifs -o username=XXX,password=YYY manually in order to mount the share. I wouuld like it to be done upon boot. Similar to a batch file in Windows but I don’t know how to accomplish this.

Would adding it to /etc/rc.local work?

Thanks, but it just ignores it. Still have to enter it although I have a text file with the whole string that I can copy and drop into terminal. A little more work, but it achieves the objective.

I’m brand new to Linux, but I’m pretty sure that Libre is trying to tell you that they suspect your problem is that you are trying to mount the Windows share before the networking has been configured so it fails. The solution they are suggesting is to use _netdev with fstab to delay the Mount attempt until after networking has been established.

_netdev did nothing.

Mounts go into /etc/fstab. This is the Linux standard mount file.

Fixed it. Went into raspi-config and selected for the network wait. Modified the code as below.

sudo mount.cifs // /home/tom/ShareFile username=XXX,password=YYY

Works like a charm.