BAT文件调用UiRobot.exe突然失效

通过BAT文件调用UiRobot.exe突然失效,每次都是BAT文件刚启动就闪退了。奇怪的是不是全是这样,有可以正常启动执行的,有的不行。我怀疑是Main.xaml中的activity的问题,但是通过studio去run又没有任何问题,所有activity都正常。有哪位大神知道原因吗,谢谢!

Hi,

For now, can you try to add pause at the end of the bat file then run the bat?
We can see error message if UiRobot fails.
And also check execution log file etc.

Regards,

Hi @Yoichi
This is what’s in my BAT file.

and where to check the execution log and error message.

Thank You

BRs
YT

HI,

Is there any reason using start command?
If there is no special reason, can you try as the following?

C:\Users\YourAccount\AppData\Local\Programs\UiPath\Studio\UiRobot.exe execute --file "xxxxxx"
pause

Regards,

Hi @Yoichi

The operation of studio is normal, but this error message is reported when BAT is running. What is the problem?

BRS
YT

HI,

It seems your project is Windows or Crossplatform (not Windows-legacy) and it’s not supported “execute --file xxx.xaml” option as the following.

As workaround, can you try to publish the project to nupkg file then set the nupkg file as argument or use --process option?

Regards,

Hi @Yoichi
Do you mean that you can use BAT files to boot normally with Windows Legacy, but you can’t use Windows?
image

How can I publish the project to nupkg file?
Thank you!

BRs
YT

Hi,

We can run xaml file of Windows-Legacy project. However cannot run xaml file of Windows project. It’s specification of Windows / Crossplatform project as the above document.

And we can publish the project into nupkg file from Publish menu on Ribbon.

Regards,

Hi @Yoichi
I am so sorry.I didn’t find it Where into nupkg file, could you help me?

Brs
YT

Hi, can you set “Publish to” in Publish Option?

image

if you choose Custom, local file path can be set.

Regards,

Hi @Yoichi
Yes, I can. But how to set “Custom URL”?

BRs
YT

Anywhere you want to save it. It’s no problem to use local file path as the following,

image

It’s right?

and BAT file is right?


r

It seems no problem. Can you try to run it?

It’ working now. Thank you so so much!
But I want close BAT file when the run finished ,so how to do that?

Can you remove pause at the end?
It’s just for checking error message

No, I keep “Pause”. It’s just remove “Pause” the BAT can be close?

If we remove pause, the black window will be closed immediately if robot process is done. Is this same as what you expect?

Yes, that is what I want.
Thank you for your help.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.