Batch file that launch commands in CMDER - batch-file

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?

Related

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.

How to fix my batch file to open the appropriate program?

I'm attempting to write a batch file that will move to the specified directory and then run the command to open my desired program. Specifically I want it to run the command HardwareSimulator so it will open the software nand2tetris provides.
I've gotten it to move to the directory I want, but the opening is my issue. Code is displayed below. I'm guessing start isn't the correct command since when I run, it just runs an infinite loop of opening cmd prompts.
My second question would be: can I only go into sub-directories of where my batch file is already stored? It would be easier to store it in my desktop, so I can just click it whenever, but I can't seem to make it back out of a directory and then go down into another.
start cmd
pushd \nand2tetris\projects\P1Codes
start HardwareSimulator
pause
You can use ..\ to go back a directory.
For instance, if you had nand2tetris in your downloads folder you could get to it from the desktop with this script. Also make sure to to include the file extension.
pushd ..\Downloads\nand2tetris\projects\P1Codes
start HardwareSimulator.exe
pause

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

Trigger a Batch Script inside a Batch Script

I have to Trigger a Batch script inside a Batch script. First I should be able to open the new command prompt and then I should be able to execute the new batch file in it.
This is The batch code
C:\XXXX\AppScanSrcCli.exe;
Script C:\XXXX\XXXX\XXXX\appscansample.bat
The above code was placed in a .bat file
you just put
start "file.bat"
instead of just the file

How to run commands on a batch file from command prompt?

I was working around creating an batch file to run commands on another batch file. for example: we want to run md C:\abc from a batch file. how can I do this?
thanks
You need to call the other batch file within a batch file:
call other_batch_file.bat

Resources