/build/static/layout/Breadcrumb_cap_w.png

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)

Posted by: Nico_K 11 years ago
Red Belt
1

It looks like it runs before the login finished.

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

Posted by: dugullett 11 years ago
Red Belt
0

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
    • That's sort of what I was thinking.. Is there any way to delay this? - mikeg77 11 years ago
      • 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 - mikeg77 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
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ