Simple backup script not executing on login
I'm trying to execute a simple backup script on login with no luck. The script runs with no problems if I run it manually or do a run now from KACE, but even though the onlogin and run as loggend in user is checked it doesn't seem to run. I'm getting a black command window that does nothing and needs me to close it before it even loads the desktop.
Here is a sample of the code I'm trying to run as a batch file.
REM Backup Desktop
echo Backing up your desktop
RoboCopy %UserProfile%\desktop\ H:\Desktop\ /MIR /R:3 /V /FP /LOG:H:\robocopy.log /TEE
I appreciate any help on this.