How can I run batch file in Uipath?

Hello Community,
Please let me know how can I run this type of code in Uipath Studio?

@echo off
taskkill /fi “imagename eq iexplore.exe” /f
taskkill /fi “imagename eq notepad.exe” /f
taskkill /fi “imagename eq EXCEL.EXE” /f
taskkill /fi “imagename eq WINWORD.EXE” /f
pause

Thanks

2 Likes

Hi @razu91

Refer to this post

Running a .bat file using start process

@razu91
use invoke powershell or open application.

Hi hope these steps could help you resolve this
—store the above string in the text file (.txt)
— use a read text file and pass the file path of the txt file and get the output with a variable of type string named out_text
— use a send hot key activity and use key as win + r, which will open the cmd window
— use a click activity to click on the run window field and use a type into activity and pass the input as “cmd[k(enter)]”
And enable these properties like sendwindowmessage, emptyfield, and clickbeforetyping in the property panel of type into activity
—then use type into activity to type inside the cmd window and pass the input as out_text and enable the same properties in the property panel as mentioned in the previous point
— use a send hot key with key enter

Hope This Would Help you
Cheers @razu91

3 Likes

Did that work buddy @razu91

Thanks @Palaniyappan, but I had make simple change.

That’s Fantastic
Cheers @razu91

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