Replies: 3 comments
-
If you don't want to add openapi, (but I still strongly recommend adding an api that exposes operable program variables) Public class CommandlineAction : PluginAction
{
...
...
public override void trigger(string clientId, ActionButton actionButton)
{
...
...
...
Process p = new Process
{
StartInfo = new ProcessStartInfo("cmd.exe")
{
UseShellExecute = false,
WorkingDirectory = workingDirectory,
Arguments = "/C " + command,
RedirectStandardOutput = saveVariable
}
};
p.Start();
...
...
... Please try to modify the following results and test the feasibility: Process p = new Process
{
StartInfo = new ProcessStartInfo("cmd.exe")
{
UseShellExecute = false,
WorkingDirectory = workingDirectory,
Arguments = "/C " + command,
RedirectStandardOutput = saveVariable
}
};
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.Start(); |
Beta Was this translation helpful? Give feedback.
-
You might as well fork the Plugin-Repo and modify it yourself, in case you dont want to wait for the Featrue to get realised. Looks like you are a little experiences with Dotnet Programming which maybe makes you able to modify and pull request the Plugin yourself, just a Tip. |
Beta Was this translation helpful? Give feedback.
-
I have implemented the hidden window a few days ago. The implementation method is my above code block, and I saw that there is a plan to do openapi todo in his main function. I really hope that the plugin author will take some time to implement this function as soon as possible. At present, there are still many unsatisfactory places in this project. I want to help you modify it, but I am not professional. I can't put my unprofessional code into the project. Although I can bear it, I still don't want to be affected by my code. Pollution! So I created a separate local plugin to keep the original plugin |
Beta Was this translation helpful? Give feedback.
-
Glad I found a really nice project I'm currently working on. At the same time I have a feature that is very reasonable in design but lacks optionality.
Windows Utils has a method in this plugin to run a command. There is no problem with this design logic, but when I
And I don't get any result when I choose to save the output variable, the reason is because the hidden window is used to run @echo off, then my thoughts are:
3. (I strongly recommend this method) If it is impossible to hide the window to get the result, then open an http interface openapi in the program, so that we can set variables without going through the program, even if I hide the cmd window, I can pass the two The second curl xxxx passes parameters to variables
In the above method, I tried a lot of solutions to solve the problem of executing the command and popping up the command line, because a window popped up during this execution, which really affected the overall effect.
Then I want to write a plugin myself to solve this problem. Before doing it, I think you can try to think about my suggestion to make the program configuration more comfortable.
Beta Was this translation helpful? Give feedback.
All reactions