|
Answer» how many cmd lines i can use in 1 batch file?
for example 30 COMMANDS for diferrent registry blah blah.... can i use all 30 comnands in 1 single batch file?Batches execution is 1 command or line at a time, and then it moves onto the next line. The only way to do more than 1 thing at the same time would be to create other instances triggered off the first instance in which say to use START THIS, START THAT, and START this other thing, otherwise it hangs at the first command instruction until it is complete before moving on to the next and so if you are launching say notepad.exe from within the batch file without a start command before it, it will wait for the Notepad.exe program to close before it moves on to the next command.
Not sure if this helps any.... what are you trying to achieve with batch that your concerned over limitations like this?
I have created very lengthy batches before and haven't reached a limit yet. One of which had over 1000 lines that was calling to a MySQL server to perform tasks.If he is asking how many consecutive lines can be included in one batch file, for sequential execution, Microsoft says there is no size limit for a batch script except those imposed by the file system and/or disk size. As for individual lines, I believe that no line should exceed 8192 characters, this figure including expanded variables. you can execute as many commands as you wish but in order , 2nd command wont INITIALIZE until 1ST has finished If you want to do 2 things at once you can use CALL to run another batch file to do 2nd command simultaneously
Quote from: JoeKkerr on May 10, 2015, 05:17:26 AM If you want to do 2 things at once you can use CALL to run another batch file to do 2nd command simultaneously
This is not so; CALL just starts an EXTERNAL batch script and returns only after it has finished. You can use unlimited commands in a batch file.
Quote from: LeonardKonrad on May 10, 2015, 06:02:56 AMYou can use unlimited commands in a batch file.
We had already ESTABLISHED that.
|