How to run an app from cmd in one line [closed] - c

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am trying to make a c program that will open my internet apps e.g. chrome, thunderbird etc.
When i am using the
system("")
function i have to do it all in one line cause everytime i reuse it, it resets my directory to where the c project is saved.
How is that possible?

Depend on what system & shell you're on, the syntax may be different
On Windows cmd just use && or &. For example
notepad && mspaint
calc & dir
&& will run the second command if the first completed successfully. & will run the command in the background on Linux/Unix, whereas it'll run the first then the second command in Windows

Related

Open file with application Batch Script [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I have a simple problem. I am writing a batch script that needs to run a file with a specific application. With the unfamiliar file extension I am using, it will prompt what app to open the file with, but I want this to be automated.
My current code is just start /wait example.idk
Help would be much appreciated
You can explicitly start the 'specific application' with the 'example.idk' as parameter. Something like: start /wait "specific program" "PathToSpecificProgram\specific application.exe" "example.idk"

How can I turn my code into an actual aplication for windows? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I developed a program written in C language using Gtk+ 3 for visual interface, and to run it I always use the comand line (Im using cygwin), but I would like to know how can i make my program an aplication, witch can be installed in windows and function like any other aplication (launch it throught files explorer or even throught the desktop enviroment)?
Thank you for your answers!
Provided that you have written the code portable, you basically have two options.
Install GTK on Windows. You can find instructions here: https://www.gtk.org/docs/installations/windows/
Rewrite the whole application for Windows API. This is NOT trivial.
On top of that, use windows installer

Im making a bat file ment to be opened with another file how would i get the file? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am going to make a code that I open with another file through the operating system i will do so by right clicking it and clicking open with then selecting my code this code will be a bat file and i need to get the path of the file it was opened with so is there a way i could do this and if so how would I? I'm compiling my go code files with this so the code should look something like this
set file = (Gets the file and path here)
go run file
is this even possible? and if i need to do this in another language what would that be
I fortunately enough found my answer so this is the code to run.
#echo off
echo %1
cmd /k

Build and execute C file in Vim using a shortcut [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I want to be able to build and execute the currently opened C file using a shortcut like in IDEs as I don't want to type a command every time I run.
Use a shell script that compiles and executes the file.
gcc file.c
./a.out
only works if you work with one file or #include, or you have to add the other files to the compiler.
As you probably work with a text editor, there are no other options than this, or doing it manually.

How to bind a key in batch? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I wanted to know if it was possible to bind key to execute a command but while the .bat file is minimized.
Any ideas?
I have searched everywhere but I have found nothing, the only thing I found was "choice" which is something I am not trying to do.
I know that this is possible because I have a file that does it, sadly it is not mine and it was converted to a .exe file so I don't know how to convert it back to a .bat file to be able to look into the code and find my answer.
There are two types of hotkeys in Windows. One to activate an open window (set when window is created) and one that sends a message key pressed to a window (set by a program anytime).
On Windows shortcuts (ie lnk files not keyboard shortcuts) there is an option to set a hotkey. If the program is not running then windows' explorer registers it to itself and starts the program in the shortcut, if the program is running activates the window.

Resources