Executing a .bat file on CMD


  1. Posts : 102
    win 10 x64
       #1

    Executing a .bat file on CMD


    Hello all,

    For a programming process we need to execute a .bat file from CMD. I'm on Windows 10 x64. When I paste the path to the file and hit Enter, the message below is expected to show up:
    Setting up environment for Qt usage...

    It happened a time and when we wanted to restart the process, because of a problem, and re-execute that file, this message wasn't shown.
    Actually when I hit enter on CMD nothing is shown up and the cursor goes back to the previous path. In other words, the .bat file won't be executed to set up the environment.

    Does anyone know how to fix this and execute the file properly, please?
      My Computer


  2. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #2

    Hellp @tomyfr,

    tomyfr said:
    For a programming process we need to execute a .bat file from CMD. I'm on Windows 10 x64. When I paste the path to the file and hit Enter, the message below is expected to show up:
    Setting up environment for Qt usage...

    It happened a time and when we wanted to restart the process, because of a problem, and re-execute that file, this message wasn't shown.

    Actually when I hit enter on CMD nothing is shown up and the cursor goes back to the previous path. In other words, the .bat file won't be executed to set up the environment.
    If the code isn't too long, perhaps you could post it so we can see exactly what you are talking about!
      My Computer


  3. Posts : 4,142
    Windows 3.1 to Windows 11
       #3

    Start "" My.bat
      My Computer


  4. Posts : 7,606
    Windows 10 Home 20H2
       #4

    Use CMD /C "D:\Testing.bat" if the next command should be run only after "D:\Testing.bat" has been completed.
      My Computer


  5. Posts : 102
    win 10 x64
    Thread Starter
       #5

    @Paul Black
    It's a programming process that I want to use the command line to build it. Code is only part of the whole things.

    I think @Kyhi and @Matthew Wai say that I must twist the path on CMD using "...". Right?
      My Computer


  6. Posts : 7,606
    Windows 10 Home 20H2
       #6

    In CMD /C "D:\Testing.bat", replace D:\Testing.bat with the actual file path.
    Note that the command works in a CMD file but not in a CMD prompt.
    If you can only use a CMD prompt, run Start "" "D:\Testing.bat"
      My Computer


  7. Posts : 16,932
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #7

    tomyfr said:
    ... when I hit enter on CMD nothing is shown up and the cursor goes back to the previous path ...
    Please post a screenshot of the command and this response to it.

    Denis
      My Computer


 

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

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




Windows 10 Forums