Click button using command-prompt - button

I need to install a program using cmd(hoping to create an batch file lately).
I have executed the program using cmd. After Installation window pops up how do I click those buttons using command prompt?
Can I use sequence of tab key, arrow keys and enter key using cmd to install the program?

You can check out AutoHotKeys
http://ahkscript.org/

There are multiple options. Some installers have command line arguments support for silent installation. Some can be extracted using specific softwares. if so there will be a file to describe it inside extracted content. Some supports hot keys. In most cases it is possible without clicking ui buttons

Related

R/RStudio set keyboard shortcuts using script/code

I'll now be working between a Mac and a PC using R/RStudio for the projects. I've got a series of keyboard shortcuts (pipe, assignment operator) for each machine using keys that are conveniently located. The two computers don't have the same keyboards.
I'd like to create a script that I can run that tells R/RStudio to change all keyboard shortcuts to x or y? My question is: Can keyboard shortcuts be set using code in scripts or the terminal?
According to the documentation :
The RStudio keybindings are saved as JSON files in the directory ~/.R/rstudio/keybindings/ -- you can find the bindings for the editor and RStudio itself at:
~/.R/rstudio/keybindings/rstudio_commands.json
~/.R/rstudio/keybindings/editor_commands.json
I think you can make a script that edit json then restart R

How do I generate a script for SQLite in Windows 10

These are instructions to generating a script in Linux
"You should start a script by issuing the command
script a2-script
This will create a file a2-script, which will log input and output at the terminal until you stop the script by typing
exit"
How do I do the same thing in windows 10? I tried typing sciprt a2-script in command promt but I get a message saying that the word script is not a recognizable command
The script command records everything you type and everything that is output on your Terminal. You can't do that in Windows easily.
The best thing to do is ignore that step and run the rest of the instructions and, when the screen is full, right-click in the window's title bar and choose edit->mark and select the text you want, then right-click in the title bar again and click edit->copy. Now you have a copy of the window and you can go in a MS-Word document, or any text editor and paste the contents to have a record of what you did.

Is there any console tool to save some commands as bookmarks or buttons?

I work often with ssh and command line scripts. I would like not to type the name of the command with arguments again and again and also to call my scripts by clicking a button.
Is there any console application that does that?
My guess is that I should fork a console tool (like konsole) and then add buttons that can be associated with commands I want to use often.
Then the better option is creating a desktop launcher , like the following as target.
Assuming you are having a gnome desktop.
Execute the following command,
gnome-desktop-item-edit --create-new ~/Desktop
This will launch a window ,which will prompt for a command name , command ,and comments.
Fill it as per your needs,
Eg: name : MyCommand_to_start_apache
command : httpd -f /my/custom/httpd.conf
That's it , if you want more fun give a try for gnome-panel or gnome-tweak-tool.
Another great tool is AutoKey

How to call an app that expects stdin input from QtGui?

I'm using Ubuntu and Qt Creator 4
I have a .cpp program in the executable form (say abc.out) that I wish to run when I press a button. It contains a number of cin and cout, so I want it to run on a "terminal" (on Ubuntu) so that I am able to input and output values to it. How can I do that?
I've tried system() and
also,
QProcess p1;
p1.start(./abc.out);
Using QProcess, my executable runs but stops at the first cout. It runs on the application output screen in Qt Creator and not on terminal.
For example:
I see on application output:
enter name:
When I type the value and press enter here, it doesn't accept the value, but moves to the next line and allows me to type further.
I want to run this abc.out file on the terminal. Any ideas would be really helpful.
Do you mean Qt Creator 2.4? In any case, on the Projects tab, you should find the Run settings section and from there you can find a "Run in terminal" checkbox. You could also use a Custom Executable option and type there: gnome-terminal --command ./abc.out The exact details can vary a bit as I'm using Qt Creator 2.5.
This should work when launching from Qt Creator, but when you use your app outside the IDE, you need to launch it from terminal and not by double clicking the executable. To fix this, I can think of two ways:
Launch a terminal window from QtGui (something like QProcess::execute("gnome-terminal --command ./abc.out"); ), though the problem is different systems have different terminal names.
Provide a Qt input/text box yourself as part of your GUI which then forwards the user input to the executable (something like myqprocess.write(input_asked_from_user_by_QtGui); ). Here you probably need to know what information to ask the user beforehand. If you want to display the cout output of the started process, you can use the read method and friends of the QProcess.
From your question I assume that you are writing an application that launches other applications using QProcess. Thats fine, but if your subprocess is waiting for data from the standard input it will wait forever since you did not provide any data. The stdin of your parent application cannot be automatically guided to the subprocess. Imagine you are starting two processes from your main app. To which child process should the input go?
If you want to communicate with child processes, you must use the QIODevice methods of QProcess and send/read data from/to that application.
The only sensible solution is to launch the target application in a terminal. Whether your own code provides the terminal window or you reuse an existing terminal application is up to you.

Consoles and Tabs

When I start the tomcat server from console using the startup.bat script, a new command window opens which is filled with java logging statements.
I use Console2 which leverages tabs for each open console window. Is it possible to let the java system create a new tab within console2 instead of just opening a new command window?
This has nothing to do with java, its merely down to the way the catalina.bat is called from startup.bat
catalina.bat can be called with either a "start" argument or a "run" argument.
run Start Catalina in the current window
start Start Catalina in a separate window
So open startup.bat, scroll to the bottom you should see
"%EXECUTABLE%" start %CMD_LINE_ARGS%
change that to
"%EXECUTABLE%" run %CMD_LINE_ARGS%
exit
I add an exit after to close the calling window.
Unless Console2 hooks any APIs that create console windows – no. And that's also highly unlikely that they do or even can. Console2 does nothing more than hook up input and output of console windows. What the programs in those do is beyond what it's interested in.

Resources