I need to execute a file.exe with certain commands from my React Native Windows app #12112
-
Hello ! I need to execute a file.exe with certain commands. At the begining I thought that this is gonna be an easy task thanks to child-process library from node js. However this library is not available for react. After that i followed this documentation for being able to call this WinRT API for executing commands on the terminal. This did not work because of access denied problem (I tried by giving the windows requirment, it did not worked). My final option was to create the native module by myself, I did a module for my app (not a distributable one) in c++, this is the implmentations :
However, here I'm having three problems :
Someone has any idea of how could I make this work. At this point I don't know what else to do so I'm open to any idea |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
I'm not sure if this is possible since UWP is a sandboxed environment, which restricts the usage of certain APIs, but you can check further at #11793. |
Beta Was this translation helpful? Give feedback.
-
Oh well, this is very unfortunate restriction. It seems I was wrong that I could build a beautiful and simple react-native-windows launcher for a game, time to switch to proper native languages like Rust. |
Beta Was this translation helpful? Give feedback.
Short answer is that an RNW app is a UWP app and has the same limitations. RNW allows you to create your UI using JavaScript and React patterns, but it can only do what a UWP app can do. So the answers available about UWP apps are going to be relevant to you. From some quick searching, here are some threads: