Run RCode via Studio/StudioX.
To execute the given script in the Command Prompt (cmd) using UiPath, use the "Invoke PowerShell" activity, which allows to run command-line commands. Here are the steps:
- Open UiPath Studio: Launch UiPath Studio and open the project where you want to execute the script
- Drag "Invoke PowerShell" Activity: Drag the "Invoke PowerShell" activity onto your workflow
- Configure Activity Properties: In the Properties panel for the "Invoke PowerShell" activity:Set the PowerShellCommand property to the following command: powershell "cmd.exe /C Rterm.exe --quiet --slave --vanilla < ""C:\some_script.R""" Ensure that IsScript is set to True
- Run the Workflow
- Save the workflow and run it.
This configuration will execute the given script in the Command Prompt using UiPath. The cmd.exe /C is used to run the command and then terminate. The Rterm.exe --quiet --slave --vanilla < "C:\some_script.R" part is the command to be executed.
Note: Ensure that the paths and filenames are adjusted according to the actual file locations and script names.
If any specific variables or parameters that need to be passed to the script, modify the PowerShell command accordingly.