Stupid Question, but I can't find the answer anywhere: How to make multi-line commands?



  • I have been trying to do this for literally hours now, and am at my wits end. I'm trying to create a cmd that opens my music visualizer, goes fullscreen, and opens music. However, I can't for the life of me figure out how to make a two part cmd! As you've probably guessed, I am no programmer. I have tried every thing that makes any sense to me to separate the first command and start the second one, but none of them work. I tried surrounding them in parentheses, spaces, colons, quotes, commas, brackets, those curly brackets, and every combination of them I can possibly imagine. I finally figured out that both | and & allow me to do a second command, but only at the exact same time (or at least that's what it seems like). I just want to be able to have a cmd that does one thing, and then does another thing. Any help is greatly appreciated.


  • administrators

    @robert-hare, assuming your computer runs Windows, you could use a batch file. Batch files are just text files with a series of commands. They end with a .bat extension. You could make a batch file with these contents for example:

    start calc
    timeout 5
    start notepad
    

    That batch file will run calculator, then wait 5 seconds, then run notepad.

    Just copy that text, run notepad, paste the text in notepad, then save the file to a folder, like to c:\tools\test.bat



  • Thanks so much! Everything's running great now!



  • If it's simple enough, you can just separate commands with a "&"

    e.g. cls & dir c:\*. & timeout 5


Log in to reply
 

Looks like your connection to TRIGGERcmd Forum was lost, please wait while we try to reconnect.