Shortcut with 2 commands


  1. Posts : 170
    Windows 7 Home Premium 64
       #1

    Shortcut with 2 commands


    Is it possible to run more than one batch file command in a shortcut? I have tried a couple of thins and they did not work.

    Example:
    Code:
    cmd /c start program
    cmd /c start another program
      My Computer


  2. Posts : 3,300
    Win7 Home Premium 64x
       #2

    I don't think you can put two commands in one shortcut, but you could write a simple batch file to call both programs and shortcut to that batch file.

    Or if I'm not following right, are you saying you can't write a batch file that calls two programs?

    Either way, check out this thread: Batch Files - Start Multiple Programs At Once
      My Computer


  3. Posts : 170
    Windows 7 Home Premium 64
    Thread Starter
       #3

    I didn't think it was possible. My goal was to keep the command window out of view. I tried using a shortcut set to open the window minimized, but that 2 files as you indicated. Oh well... thanks anyway.
      My Computer


  4. Posts : 6,285
    Windows 10 Pro X64
       #4

    You can & them together perhaps:

    cmd /c start program & start another program
      My Computer


  5. Posts : 170
    Windows 7 Home Premium 64
    Thread Starter
       #5

    Ztruker said:
    You can & them together perhaps:

    cmd /c start program & start another program
    Never thought of that, IT WORKS, thanks....
      My Computer


  6. Posts : 4,161
    Windows 7 Pro-x64
       #6

    cmd /c start program & start another program
    You can use multiple commands separated by the command separator && for string, but you must enclose them in quotation marks (for example, "command&&command&&command").

    You can run a batch file that will execute as many programs as you want. Use the Echo Off to keep the batch file "silent". If you must use the CMD command, use /k and /q parameters to run and continue and echo off respectively.

    Forgot to add the link to the CMD syntax. http://technet.microsoft.com/en-us/l.../bb490880.aspx
      My Computer


  7. Posts : 170
    Windows 7 Home Premium 64
    Thread Starter
       #7

    The reason I was avoiding "/k" is that the command window stays open.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 22:52.
Find Us