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   [ - ] Hide Comments


Please log in to comment

Community Chosen Answer



It looks like it runs before the login finished.

If this is the case the %UserProfile% is not populated and it fails here.

Answered 04/11/2013 by: Nico_K
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity



Is "Allow Run While Logged Off" checked?

Answered 04/11/2013 by: dugullett
Red Belt

  • yes
    • 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.
  • 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.
    • That's sort of what I was thinking.. Is there any way to delay this?
      • I did a quick test changing the script to use local drives without the %userdata% and still the same. Seems like it wants to start to run then gets stuck
  • Can you enable logging on the Kace client? Either that or is the robocopy.log showing anything?
  • 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?
Please log in to comment