お客さんが使っているロボについて、
基本的な仕組みとして、手動で起動するのではなく、タスクスケジューラにより、PowerShell経由で自動的に、定期的に起動されます。
2017バージョンのUiPathであれば正常に動きますが、2018.4.6にバージョンアップした後起動されなくなりました。
【PowerShellスクリプト】
#実行Xamlを取得
$FolderPath = Split-Path $myInvocation.MyCommand.Path -Parent
$XamlFilePath = $FolderPath + “\targetXaml.txt”
$XamlName = (Get-Content $XamlFilePath) -as [string]
$TaskStop = “false”
#条件を満たすまで待機する
while($true){
try{
#UiRobotのプロセスを全て取得する
foreach($ProcessName in (Get-Process UiRobot -ErrorAction SilentlyContinue)){
if ($ProcessName.MainWindowTitle -ne ""){
#ユーザーが実行しているロボットプロセスのみにフィルタリング
Write-Host $ProcessName.Name
#プロセス終了まで待機
$ProcessName.WaitForExit()
}
}
}
catch{
Write-Host "No Process"
}
Finally{
#targetXaml.txtで指定したロボットを起動する
Write-Host "Start Process"
$targetXaml = "-file:" + $XamlName[0]
Start-Process "C:\Program Files (x86)\UiPath\Studio\UiPath.Agent.exe" -ArgumentList $targetXaml
$TaskStop = "true"
}
#フラグを戻して処理を中断
if($TaskStop -eq "true"){
break
}
}
【targetXaml.txt】
“C:\Users\zhao.cao\Desktop\在宅勤務\作業フォルダ\Main.xaml”
今在宅勤務のため、お客さんの環境にアクセスできず、エラーの再現などもできないため、もっと詳しい情報を提供できませんが、一応これはどういう原因なのかを大ざっぱにご教示いただければ助かります!