I am not able to open the xaml file from a bat file

I am a beginner with Ui Path Community Edition . I am using to automate a citrix flow .
flow works fine when i open it from studio. But when i open it from Batch file as below it gives the error as below.

Batch File
@ECHO OFF
Start “” /min “C:\Users\akvarshney\AppData\Local\UiPath\UiPath.Studio.exe” /file:“C:\Users\akvarshney\Documents\UiPath\OMS_Citrix_Launch\OMSLaunchSeq.xaml”

Error
Open Document Error: UiPath.Studio.Contracts.RecoverableException —> System.NotSupportedException: The given path’s format is not supported.
at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.File.GetAttributes(String path)
at System.IO.Abstractions.FileWrapper.GetAttributes(String path)
at UiPath.Project.WorkflowProjectRepository.LookupProjectFile(String startPath, Boolean searchRecursively)
at UiPath.Studio.Plugin.Workflow.Shared.Project.BaseWorkflowProjectFactory.LookupProjectFile(String startPath, Boolean searchRecursively)
at UiPath.Studio.Core.CommonServices.ProjectServiceBase.LookupProjectFile(String startPath, Boolean searchRecursively)
at UiPath.Studio.Shell.Services.OpenCloseCommandsService.d__24.MoveNext()
— End of inner exception stack trace —
at UiPath.Studio.Shell.Services.OpenCloseCommandsService.d__24.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Studio.Shell.Services.OpenCloseCommandsService.d__17.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Studio.Shell.ShellApplication.StudioShellApplication.d__18.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Studio.Shell.ShellApplication.StudioShellApplication.<b__17_0>d.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler), HResult -2146233088

hi @Ankitvarshney

to run the bot using batch file the command will be:

@ECHO OFF
(your UiRobot location) by default its (C:\Program Files (x86)\UiPath\Studio\UiRobot.exe)” -file “(your nupkg location of the bot created when you publish the bot)”
pause

I hope it will work.

Cheers :grinning:

Regards
Achal Sharma

Hi Achal

I tried
start “” /min “C:\Users\ankit\AppData\Local\UiPath\app-19.8.0\AgentDesktop\AgentDesktop.exe” /file:“C:\ProgramData\UiPath\Packages\DemoLaunch.1.0.1.nupkg”

But only Robot launches and File is not running
:frowning:

@Ankitvarshney Try this.
This is better than bat.

Or try write the bat like this:
“C:\Users\luca.souza\AppData\Local\UiPath\app-19.8.0\UiRobot.exe” -file “C:\Users\luca.souza\Documents\UiPath\ConversorBinario\Main.xaml”

1 Like

Thanks Man.It worked like magic:)

1 Like

@lucasimaque Hey Man,
Need one more help. The process i am running on my system .Now i need to run it on my boss system.How to do that.

Should i install UI studio in his system and copy xaml file into his uipath.

@Ankitvarshney
I have this problem too.
But my robots run on a virtual machine with a uipath community version installed. And my files are on a local network and this virtual machine can access my robots.

This is the way I found to make it works, tell me if you found another or better way, please haha.

By sytem i mean VM only​:grimacing::grimacing:
Is there a way my boss can run it from his vm or something😁

If I understand correctly, you only need to install the uipath community on the VM and the robot files must also be on the VM. And bat or vbs need and be executed on the VM too.

Hey Lucas,

I am not able to open a shared drive:(

Put this in a notebook and save with .vbs
You just need to change the WORKFLOW PATH with the path of your xaml or jason.

Option Explicit

Dim WORKFLOW_PATH
WORKFLOW_PATH = “Insert your workflow”

Dim uiPathFolder
Dim user
Dim objFSO
Dim folder
Dim objRE
Dim uiRobotPath
Dim oShell
Dim objShell
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set objRE = New RegExp
Set objShell = WScript.CreateObject (“WScript.shell”)

With objRE
.Pattern = “\d+.\d+.\d+”
.IgnoreCase = True
.Global = False
End With

uiPathFolder = "C:\Users" + CreateObject(“WScript.Network”).UserName + “\AppData\Local\UiPath”

For Each folder In objFSO.GetFolder(uiPathFolder).SubFolders
If objRE.Test(folder) Then
uiRobotPath = folder.Path + “\UiRobot.exe”
End If
Next

objShell.Run “”+ uiRobotPath +" -file " + WORKFLOW_PATH + “”

Hi @Ankitvarshney

below command is working fine for me
give it a try

start “” “C:\Users\User\AppData\Local\UiPath\app-19.6.0\UiRobot.exe” -file “C:\Users\User\Desktop\OpenEmpPortal\Main.xaml”

1 Like

Thank you @kgmaheshwari,this code helped me.

Thanks man :slight_smile:
Next thing i am stuck on is
I need to find the specific file count in a folder as per the naming convention.

Hi @kgmaheshwari … I am stucked with this problem …
just want to run the bot through Batch file and created it by giving UiRobot path and Main.Xaml path for respective process … and then I just want run another process and removed first one gave another process Xaml . When i tried to run the Bot it is taking the first process main.Xaml only . @Palaniyappan

And then I removed Main.xaml path in batch file script … When i tried to run the bot It is automatically taking first process Xaml on bot running (Not into Batchfile)

Can you please help me on this

using robot.exe we can able to achieved @Ankitvarshney