Setting the Default app via UI Path


i have an activity that opens a PDF file and this should be opened using adobe acrobat. however, by default the PDF files are opened using a browser. which activity should i use so that the default app to open PDF files will be adobe acrobat?


try start process with inputs as path of application and file


Hi @redanime94

You can use the ‘Start Process’ activity to open the pdf file in adobe acrobat.

In the properties of the ‘Start Process’ activity, set the following data:

FileName - "C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe"

Argument - "your file's full path"


Hope this helps,
Best Regards.

thanks for that. so what if the file is automatically generated and opened by another application?


Well, in that case, you need to modify the default application settings in your system. You can do it like this:

Go to settings>Search 'Default Apps'>Set Default By Apps>Click on Acrobat>Manage>Change the .pdf opening to Acrobat


Hope this helps,
Best Regards.

Thanks. I have actually done that, i.e. manually set the default setting. I was just wondering whether it’s possible or not as forgetting to set that setting will mean the bot will error out.


It is better to modify the default setting manually in the system, as it’s a one-time change that you have to do. Although, you can run this PowerShell at the beginning of your process to check if the default app is set to acrobat or not. If it’s not, the script will automatically set it to the same:

$acrobat = "C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Acrobat.exe"
$pdfassoc = ".pdf"
$regpath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$pdfassoc\UserChoice"
$progid = (Get-ItemProperty -Path $regpath -Name Progid).Progid
if ($progid -ne "AcroExch.Document.DC") 
    Set-ItemProperty -Path $regpath -Name Progid -Value "AcroExch.Document.DC"
    $cmd = "cmd /c ftype AcroExch.Document.DC=`"$acrobat`" `"%1`""
    Invoke-Expression $cmd

You might have to do some extensive R&D on this in order to implement the same according to your use case.

Hope this helps,
Best Regards.