Bat scheduled task only works when logged in


i have batch file looks this:

@echo off
mkdir d:\sql_backup\test
set currdate=%date:/=-%
set currtime=%time:~-10,1%-%time:~-8,2%-%time:~-5,2%

set tqpath=d:\smartermail\
set winrar=c:\program files\winrar\rar
set dest=d:\sql_backup

cd /d %tqpath%
"%winrar%" -r "%dest%\smartermail-d-%currdate%_%currtime%.rar" *.*

the problem runs correctly when logged in. put simple mkdir command in file , directory created, know task running. wrong in file? why won't work when not logged in? have scheduled task setup correct user , password, correct start in directory, , run if logged on not checked. running server 2003.

-thank you


is batch file on local server on scheduled task created  or on remote one?  if task has on network, use domain admin account , use unc path \\servername\sharename\foldername instead of using mapped drive.


@ status column in scheduled tasks , see if offers helpful information, such "the scheduled task did not run because of incorrect password or user name entered." can click on advanced menu , select view log , see helpful information specific task.


in other posts, have solved problem adding /silent switch @ end of run command. can give try.



Windows Server  >  Server Manager



Comments

Popular posts from this blog

Error: 0x80073701 when trying to add Print Services Role in Windows 2012 Standard

Disconnecting from a Windows Server 2012 R2 file sharing session on a Windows 7,8,10 machine

Windows 2016 RDS event 1306 Connection Broker Client failed to redirect the user... Error: NULL