bat from a bat

Discussion in 'Scripting' started by Carlo, Jun 14, 2007.

  1. Carlo

    Carlo Guest

    i need to launch a .bat from another .bat, i try to do this but after the
    execution of the second bat the execution of the first doesnt continue:

    (non riesco a lanciare un file bat da un file bat, finita l'esecuzione del
    secondo bat non continua l'esecuzione del primo)

    @echo on
    ftp -i -s:"C:\migration\ftp_get.txt"
    del torun.bat
    ftp -i -s:"C:\migration\ftp_put.txt"
    del *.dat

    if i comment torun.bat, the second bat, everything goes right
    anyone can help me????
    Carlo, Jun 14, 2007
    1. Advertisements

  2. Carlo

    Nitro Guest

    Dal tuo inglese "maccheronico" ipotizzo tu sia italiano, quindi ti rispondo
    in italiano

    Che cosa fa' torun.bat ? (posta il listato)
    Se in torun.bat esegui solo il comando "pause", cosa succede ?
    Hai provato a usare START /B torun.bat al posto di torun.bat ?

    I comandi successivi a torun.bat devono essere eseguiti dopo che torun.bat รจ
    terminato o possono essere eseguiti contemporaneamente ?

    Nitro, Jun 14, 2007
    1. Advertisements

  3. Carlo

    Carlo Guest

    grazie ho risolto
    basta nel primo fare la chiamata al secondo con un
    CALL torun.bat
    grazie mille a tutti
    Carlo, Jun 14, 2007
  4. Carlo

    John John Guest

    John John, Jun 14, 2007
  5. Carlo

    J Ford Guest

    You can always do the call and that should work, however also check the
    'torun.bat' and see if it has any 'exit' syntax in it and remove that.
    J Ford, Jun 15, 2007
  6. Carlo

    D.R. Guest

    If you don't have an exit then a virus could (I suppose) attach itself to
    the end of your script, this is why I always add:
    exit /b the exit point.

    ....and this just ends the current script and returns to the caller.

    ....and also gives you the chance to exit with a status code / errorlevel

    help exit

    D.R., Jul 9, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.