# Execute Java Script in Uipath

**URL:** <https://forum.uipath.com/t/execute-java-script-in-uipath/557761>\
**Category:** Studio\
**Tags:** activities-panel, question, studio, uiautomation, activities\
**Created:** [26.Июнь.2023 10:59:41 UTC](https://forum.uipath.com/t/execute-java-script-in-uipath/557761 "2023-06-26T10:59:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![besakkiappan46](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/besakkiappan46/32/496850_2.png) [@besakkiappan46](https://forum.uipath.com/u/besakkiappan46)\
**Post date:** [26.Июнь.2023 10:59:41 UTC](https://forum.uipath.com/t/execute-java-script-in-uipath/557761/1 "2023-06-26T10:59:41Z")

</div>

Hi,  
Can you pls let me know a way to execute Java Script program inside UiPath. I could see “Inject JS Script” activity. But it didn’t work. It asks to indicate a target (Ideally a browser)

---

<div class="post-metadata">

**Author:** ![Anil\_G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anil_g/32/524291_2.png) [@Anil\_G](https://forum.uipath.com/u/Anil_G)\
**Post date:** [26.Июнь.2023 11:10:28 UTC](https://forum.uipath.com/t/execute-java-script-in-uipath/557761/2 "2023-06-26T11:10:28Z")

</div>

@besakkiappan46

Ideally a js needs an ide…so you can just open a browser and use inject js in that attach

cheers

---

<div class="post-metadata">

**Author:** ![besakkiappan46](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/besakkiappan46/32/496850_2.png) [@besakkiappan46](https://forum.uipath.com/u/besakkiappan46)\
**Post date:** [26.Июнь.2023 11:14:39 UTC](https://forum.uipath.com/t/execute-java-script-in-uipath/557761/3 "2023-06-26T11:14:39Z")

</div>

I want to execute the JS program in the Windows command prompt. How could I achieve it?

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [26.Июнь.2023 11:19:55 UTC](https://forum.uipath.com/t/execute-java-script-in-uipath/557761/4 "2023-06-26T11:19:55Z")

</div>

Hi,

UiPath doesn’t have ability to run JavaScript in itself.  
Can you try InjectJSScript and it runs JavaScript code in Browser JavaScript engine.  
Or can you share whant you want to achieve?

Regards,

---

<div class="post-metadata">

**Author:** ![ppr](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ppr/32/464097_2.png) [@ppr](https://forum.uipath.com/u/ppr)\
**Post date:** [26.Июнь.2023 11:23:32 UTC](https://forum.uipath.com/t/execute-java-script-in-uipath/557761/5 "2023-06-26T11:23:32Z")

</div>

> [@Use V8 JavaScript Engine via ClearScript Library with UiPath](https://forum.uipath.com/t/use-v8-javascript-engine-via-clearscript-library-with-uipath/479516):
>
> [Bridge] [V8](https://v8.dev/) is a JavaScript engine from Google which is used in the Chrome Browser, Node.js and other applications. It implements [ECMAScript](https://en.wikipedia.org/wiki/ECMAScript) (the JavaScript standard) and [WebAssembly](https://en.wikipedia.org/wiki/WebAssembly). [ClearScript](https://github.com/microsoft/ClearScript) from Microsoft is a dotNET assembly that makes it easy to add this kind of scripting to your UiPath workflow, because it contains the V8 engine in its native assembly packages. Compared to the approach of [using Node.js, described in my tutorial,](https://forum.uipath.com/t/how-to-use-node-js-with-javascript-in-combination-with-uipath/471987) here the V8 engine is used via ClearScript and the integ…

> [@UiPath Programming Languages Integrations Scenarios](https://forum.uipath.com/t/uipath-programming-languages-integrations-scenarios/358472):
>
> The UiPath RPA platform offers many possibilities to realize automation workflows. One aspect is the integration of existing programs created with different programming languages. In this post I would like to pick out exactly this perspective. A kind of backward view of which programming languages can be used seamlessly with UiPath. The Programming Languages For the arrangement of the programming languages I followed the current [Tiobe index](https://www.tiobe.com/tiobe-index) from December 2022 and [PYPL PopularitY o…](https://pypl.github.io/PYPL.html)

---

<div class="post-metadata">

**Author:** ![besakkiappan46](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/besakkiappan46/32/496850_2.png) [@besakkiappan46](https://forum.uipath.com/u/besakkiappan46)\
**Post date:** [26.Июнь.2023 11:24:28 UTC](https://forum.uipath.com/t/execute-java-script-in-uipath/557761/6 "2023-06-26T11:24:28Z")

</div>

Sure @Yoichi ,  
I have a Java script program built and it gets executed in the Windows Command prompt. I need to automate it where the bot should execute the program (JS program) in the command prompt and capture the result of the execution. But I don’t find an activity to either directly execute JS program or access command prompt to execute it. I don’t want to go for Ui Automation since it is unreliable.

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [26.Июнь.2023 11:47:18 UTC](https://forum.uipath.com/t/execute-java-script-in-uipath/557761/7 "2023-06-26T11:47:18Z")

</div>

Hi,

If we can set allow access to File URLs in extension setting, we can open local simple file and use it stability.(because there is no network access)

 ![image](https://global.discourse-cdn.com/uipath/original/4X/e/9/9/e9949cfaa99a1df8861aef85b2de146e0fa30375.png)

Can you try the following sample?

 ![image](https://global.discourse-cdn.com/uipath/original/4X/d/2/a/d2a2ae2da43917a749a56e37fc7791050fcecca2.png)

[Sample20230626-6L.zip](https://forum.uipath.com/uploads/short-url/fVXSh12nDPulGDps0koQgMcGH2Z.zip) (5.5 KB)

Regards,

---

<div class="post-metadata">

**Author:** ![oscar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/oscar/32/177797_2.png) [@oscar](https://forum.uipath.com/u/oscar)\
**Post date:** [26.Июнь.2023 19:12:58 UTC](https://forum.uipath.com/t/execute-java-script-in-uipath/557761/8 "2023-06-26T19:12:58Z")

</div>

Use Deno to run your JS without a browser.

> **[Deno — A modern runtime for JavaScript and TypeScript](https://deno.com/runtime)**
>
> Deno is a simple, modern runtime for JavaScript and TypeScript that uses V8 and is built in Rust.

---

<div class="post-metadata">

**Author:** ![postwick](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/postwick/32/227083_2.png) [@postwick](https://forum.uipath.com/u/postwick)\
**Post date:** [26.Июнь.2023 20:34:11 UTC](https://forum.uipath.com/t/execute-java-script-in-uipath/557761/9 "2023-06-26T20:34:11Z")

</div>

Use Application/Browser to open CMD.exe

Type Into to enter the command that runs the JS app

Keyboard Shortcuts activity to send Enter to run the command

Get Text to get the resulting text from the screen
