Scheduling a back office robot using task scheduler

:clap::clap::clap::clap::clap::clap:: :+1::+1::+1::+1::+1:

1 Like

@acaciomelo The attached zip file shows up empty when extracted. Is there anyway you could send the sample .bat file to me?

Hi @atevis,

This is the content inside the .bat file.

start “” /min “C:\Program Files (x86)\UiPath Studio\UiRobot.exe” /file:"%~dp0Main.xaml" /input:"{‘StartedByTaskScheduler’:true}"

Great, thanks! So for a BOR or even a FOR, you have it run the xaml file, not the nupkg file?

The problem is the task scheduler is able to run the process when a user is logged in but it is not able to do the same when the user is not logged in. I have changed all the settings as required but it is still not working

Hi, please check this Start from command line

You have to use options /executor and /monitored with UiPath 2016.x

With UiPath 2017.x you have to use option --monitor. Here’s an example .bat file content.
START “” “C:\Program Files (x86)\UiPath Platform\UiRobot.exe” -file “C:\Users\User\Documents\UiPath\Project\Main.xaml” --monitor

You can also use this command directly in Task Scheduler without a .bat file. Just configure the schedule as Start a program, give the path to UiRobot.exe and arguments exactly as they are in the example above.

did not get your point.
here what i have done

why this is working when i am logged in and not working when i am logged of

Do you have /monitored and /executor as arguments in your schedule?
Have you given “Log on as batch job” user rights to your user account? https://technet.microsoft.com/en-us/library/cc957131.aspx

Please check the link in my previous post again and also check the links in that post.

everything is in place it is just that when the user is logged in the scheduler triggers the process and when the user is not logged in it does not.
However the task history of scheduler shows that the task was triggered but i can see that no logs were generated

What about the scheduler option “Run whether user is logged on or not”, do you have that set?

afcourse dude it is there…

{
“NuGetApiKey”: “”,
“UiPathServerUrl”: “”,
“TracingLevel”: “Information”,
“RobotKey”: “”,
“LoginToConsole”: true,
“ResolutionWidth”: 0,
“ResolutionHeight”: 0,
“ResolutionDepth”: 0,
“LowLevelTracing”: false,
“NuGetServerUrl”: “%ProgramData%\UiPath\Packages”
}

this is the content of uipath.setings file

Is this correct? mind u the task scheduler did work fine for a couple of days and then without any property change it stooped working

UiPath settings look fine. So the UiPath execution log doesn’t get generated when the task launches when the user is logged off?

so today i had scheduled the task scheduler to run the process at 12:40
The task scheduler history shows that the last run time is 12:40
but i cannot see any log file getting generated
Only a studio file gets generated
here are the contents of it

%12:41:31:058 => [INFO] [Orchestra.Services.ShellService] [6] Starting UiPath Studio v2016.2.6274.33252 ()
12:41:33:821 => [ERROR] [UiPath.Workflow.Logging.StudioTraceListener] [6] System.IO.FileNotFoundException: Could not find file ‘C:\Users\robot4\AppData\Local\UiPath\UiStudio.settings’.
File name: ‘C:\Users\robot4\AppData\Local\UiPath\UiStudio.settings’
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver)
at System.Threading.CompressedStack.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state)
at System.Xml.XmlTextReaderImpl.OpenUrl()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at UiPath.Configuration.UserSettingsProvider.get_RootDocument()
12:41:56:919 => [ERROR] [UiPath.Workflow.Logging.StudioTraceListener] [6] System.NullReferenceException: Object reference not set to an instance of an object.
at UiPath.Workflow.LibraryExplorerViewModel.RefreshTree()
12:41:58:694 => [WARNING] [UiPath.Workflow.Logging.StudioTraceListener] [6] SharpSvn.SvnInvalidNodeKindException: ‘C:\Users\robot4\Desktop\RPACODE_september27\RPA_Openco_Automation_20July\RPA_OpenCo\Enquiries_Automated’ is not a working copy
at SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, SvnException error, Object targets)
at SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, svn_error_t* error, Object targets)
at SharpSvn.SvnClient.Status(String path, SvnStatusArgs args, EventHandler1 statusHandler) at SharpSvn.SvnClient.GetStatus(String path, SvnStatusArgs args, Collection1& statuses)
at UiPath.Project.SourceControl.SVNSourceControl.<>c__DisplayClass53_1.b__0()
at UiPath.Project.SourceControl.SVNSourceControl.SVNClientAction(Func1 action) at UiPath.Project.SourceControl.SVNSourceControl.GetSvnStatus(String path) 12:41:58:707 => [WARNING] [UiPath.Workflow.Logging.StudioTraceListener] [6] SharpSvn.SvnInvalidNodeKindException: 'C:\Users\robot4\Desktop\RPACODE_september27\RPA_Openco_Automation_20July\RPA_OpenCo\Enquiries_Automated' is not a working copy directory at SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, SvnException error, Object targets) at SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, svn_error_t* error, Object targets) at SharpSvn.SvnClient.CleanUp(String path, SvnCleanUpArgs args) at UiPath.Project.SourceControl.SVNSourceControl.<CleanUpWorkspace>b__47_0() at UiPath.Project.SourceControl.SVNSourceControl.SVNClientAction(Func1 action)
at UiPath.Project.SourceControl.SVNSourceControl.CleanUpWorkspace()
12:41:58:710 => [WARNING] [UiPath.Workflow.Logging.StudioTraceListener] [6] SharpSvn.SvnInvalidNodeKindException: ‘C:\Users\robot4\Desktop\RPACODE_september27\RPA_Openco_Automation_20July\RPA_OpenCo\Enquiries_Automated’ is not a working copy
at SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, SvnException error, Object targets)
at SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, svn_error_t* error, Object targets)
at SharpSvn.SvnClient.Status(String path, SvnStatusArgs args, EventHandler1 statusHandler) at SharpSvn.SvnClient.GetStatus(String path, SvnStatusArgs args, Collection1& statuses)
at UiPath.Project.SourceControl.SVNSourceControl.<>c__DisplayClass53_1.b__0()
at UiPath.Project.SourceControl.SVNSourceControl.SVNClientAction(Func`1 action)
at UiPath.Project.SourceControl.SVNSourceControl.GetSvnStatus(String path)

sharing with u some screenshots of the task scheduler

One more thing: have you added the proper user credentials to Windows Credential Store? For example I have added these credentials:
UiPath:user=Domain\DomainUser
and
Domain\DomainUser