How to run several batch files without open shell windows? - batch-file

I've got some .bat files with start xxx and I need to run them all in another file
so if do start xxx.bat there I will get running xxx and command line shell. I don't need another shell so how to run batch file without opening another shell? or close it's shell after executing.

If I understand correctly, you just want to use call instead of start.
Example:
call xxx.bat

Related

Batch file that launch commands in CMDER

I need to find a way to execute commands in bat file via cmder.
When I put start -cur_console:s1T50H -cur_console:d:C:\Users\MY\Path\ inside cmder its open another shell as i want.
What should I do to make it happen when I execute my bat file?
My .bat file right now:
#echo off
start C:\Users\PATH\TO\CMDER\FOLDER\cmder.exe
pause
What should I write after start the cmder?

How can I run batch in a shell?

I want to have a batch file that opens the command prompt, launches the iex shell within it and then starts my elixir program. The issue I'm having is that as soon as I invoke iex -S mix, which compiles the code and opens the elixir shell, then I am unable to write more commands into it.
:: Start iex and compile with mix
iex -S mix
:: Start elevators
Elevator.Supervisor.start
pause
The last part Elevator.Supervisor.start never runs, for some reason. I guess this is because I opened a shell within the command prompt. Is there a way to feed commands into the iex?
TL;DR use .iex.exs file which is loaded by iex upon start.
Create a file named .iex.exs in the project directory root with the content you want to be run:
Elevator.Supervisor.start()
remove any reference to elixir code (which is now located in .iex.exs) from your .bat file
run .bat file
enjoy.

Run multiple lines from .bat file

I'm trying to get a bat file together and not sure how to run multiple cmd lines through the .bat.
Objective: I want to be able to click on this .bat file to open cmd prompt, then to find a "folder" in the directory, rename the "Folder" then move the location of the folder then find a existing Folder and put it in the same directory.
Problem: i know how to run these cmds in the prompt without an issues.
So far this is what i have:
#echo off
start cmd.exe /k cd %AppData%\Microsoft\Network\Connections
#echo off
and then just write your commands its that simple
A .bat file is executed in a terminal window automatically, you don't need to call cmd.exe or anything like that.
Every single line you write in the .bat file is going to be executed one by one, so you just need to write multiple lines with all the instructions and then you can double click on your new file to run the script.
If you are not familiar with Windows commands for the terminal, you can find more info on the web about how to find a folder, rename it, etc. There are many things you can do by command line and this is not the right place to explain how to use them.

Starting a batch file from another batch file only opens CMD

When I start a batch file from another batch file, it just opens a new CMD window named just "TEST.bat", and doesn't run the actual batch. Running it manually works fine.
cd %~dp0\Colours\TEST.bat
start "TEST.bat"
I have tried many different ways to run the batch, but it all does the same thing. I've also tried to run the batch as administrator but same result again.
Full code(not finished): http://pastebin.com/GE8yJP0J
To run another batch file, use call not start. Also: cd expects a directory, not a filename.
cd "%~dp0\Colours"
call TEST.bat

Bat file service runs many times

I have created a bat file to start a Ruby service
working code is:
ruby C:\folder\Projects\folder\folder\script\server
It works fine when I open a command prompt ,paste it and run.
but not working when I created a bat file of it.
bat content is
ruby C:\folder\Projects\folder\folder\script\server
pause
when I run that bat file, it not working as expected. It runs multiple as shown below.
Please help me to resolve it.
The Batch file must have a name different than the process you want to run in it. In this case, the Batch file must not be named ruby.bat, because in this case, the line:
ruby C:\folder\Projects\folder\folder\script\server
placed in the Batch file imply a recursive invocation of itself...

Resources