It is probably a mapped drive issue. The task scheduler just does a user impersonation and depending on how you mapped the drives they might not be visible. The simplest solution is to use the UNC path, \server\share\, instead of the drive letter.
Modify your BackupProg.bat file to execute these commands.
dir G:\
dir Y:\
robocopy G:\ Y:\backupdata2\ /MIR
Configure the task scheduler to execute program cmd.exe. In the arguments field put "/c c:\YourFolderName\BackupProg.bat 1> c:\YourFolderName\BackupProg.log 2>&1"
Run the task and check the log file contents. The dir commands will verify that the drive letters are visible/accessible. The redirects will capture stdout and stderr.