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.
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
Nico_K
11 years ago
Posted by:
dugullett
11 years ago
Is "Allow Run While Logged Off" checked?
Comments:
-
yes - mikeg77 11 years ago
-
Turn on logging on your test machine and run it again. Is H: a network drive I'm assuming? I'm wondering if it's actually mapped at that time. Try changing to somewhere local for testing, and see if the results change. - dugullett 11 years ago
-
It could be running before the user is fully logged in. The user level variable %UserProfile% may not be valid at the time the script is executing because the user is not fully logged in and the profile and hive are not fully established. - SMal.tmcc 11 years ago
-
Can you enable logging on the Kace client? Either that or is the robocopy.log showing anything? - dugullett 11 years ago
-
I did get the script to work using local drives (after being impatient the first time around). I'm pretty sure the problem is the batch not being able to find the user profile though at login. Is there anything I can do to delay the script until the login is complete? - mikeg77 11 years ago