#FOR BACKUP
BACKUP DATABASE [DBNAME] TO DISK = N'D:\BackUp\Full_DBNAME_comp.bak' WITH COMPRESSION GO BACKUP DATABASE [DBNAME] TO DISK = N'D:\BackUp\Full_DBNAME_diff.bak' WITH COMPRESSION, DIFFERENTIAL GO
#FOR RESTORE
USE master; GO RESTORE DATABASE [DBNAME] FROM DISK = N'D:\BackUp\Full_DBNAME_comp.bak' WITH NORECOVERY, REPLACE GO RESTORE DATABASE [DBNAME] FROM DISK = N'D:\BackUp\Full_DBNAME_diff.bak' GO
Back up to a network share file
For SQL Server to access a remote disk file, the SQL Server service account must have access to the network share. This includes having the permissions needed for backup operations to write to the network share and for restore operations to read from it. The availability of network drives and permissions depends on the context is which SQL Server service is running:
To back up to a network drive when SQL Server is running in a domain user account, the shared drive must be mapped as a network drive in the session where SQL Server is running. If you start Sqlservr.exe from command line, SQL Server sees any network drives you have mapped in your login session.
When you run Sqlservr.exe as a service, SQL Server runs in a separate session that has no relation to your login session. The session in which a service runs can have its own mapped drives, although it usually does not.
You can connect with the network service account by using the computer account instead of a domain user. To enable backups from specific computers to a shared drive, grant access to the computer accounts. As long as the Sqlservr.exe process that is writing the backup has access, it is irrelevant whether the user sending the BACKUP command has access.
https://www.mssqltips.com/sqlservertip/3499/make-network-path-visible-for-sql-server-backup-and-restore-in-ssms/