Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

To activate some commands from mozilla SDK I have to run batch file called "activate". I don't want to find the proper file each time I want to do something with this SDK, so I created batch file:

cd C:\Users\piotr_000\Documents\FirefoxAddOnSDK\addon-sdk-1.16\bin
activate
cd C:\Users\piotr_000\Documents\Firefox_AddOns\first_addon

I don't know batch very well, can you tell me how can I tell computer to wait for another commands that I will type in that opened console?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

You can start another CMD and wait for it:

dir
start /wait cmd
dir

The shell opens in its own window. When you are done you have to exit from it in order to continue batch execution.

UPDATE

If you don't want to wait:

dir
dir
cmd

UPDATE 2

activate batch file was making the caller to end its execution too. The solution was:

cd C:\Users\piotr_000\Documents\FirefoxAddOnSDK\addon-sdk-1.16\bin
call activate
cd C:\Users\piotr_000\Documents\Firefox_AddOns\first_addon
cmd
share|improve this answer
    
I don't want to stop executing in the middle. I want the .batch file to execute all of its commands and then not to close itself. –  Ludwik11 May 4 at 14:42
    
Check the update... –  drk.com.ar May 4 at 14:44
    
still doesn't work :/ The CMD opens and after exectuting all commands, closes immediately –  Ludwik11 May 4 at 14:47
    
Are you sure the CMD is reaching the last line? The code you pasted is the actual code of your CMD file? –  drk.com.ar May 4 at 14:54
1  
Is activate another CMD/BATCH file? If it is add start before it: "start /wait activate" –  drk.com.ar May 4 at 15:03

if you just insert "cmd" into your script at the appropriate moment then you will get a new prompt in the same window. After you enter any commands you should type "exit" and the script will continue. Just be aware that the script will be in the same directory as before the "cmd" was called.

*Previous part of the batch.*
cmd
*Put your commands in here and then type exit*
*Batch will continue here.*
share|improve this answer
    
I don't want to stop it during executing commands ;) Now it closes itself after ending doing what I typed in batch file. I don't want that –  Ludwik11 May 4 at 14:44

You can do something like this:

@echo off
cd C:\Users\piotr_000\Documents\FirefoxAddOnSDK\addon-sdk-1.16\bin
call activate
cd C:\Users\piotr_000\Documents\Firefox_AddOns\first_addon
:while1:
set /p "command=type in a command: "
:: do something here...
%command%
echo.press ^CTRL+C^ to exit.
>nul pause
goto :while1
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.