Executing a .bat file on CMD


  1. Posts : 85
    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. Paul Black's Avatar
    Posts : 12,436
    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. Kyhi's Avatar
    Posts : 3,563
    Windows 3.1 to Windows 10
       #3

    Start "" My.bat
      My Computer

  4. Matthew Wai's Avatar
    Posts : 5,349
    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 : 85
    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. Matthew Wai's Avatar
    Posts : 5,349
    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. Try3's Avatar
    Posts : 7,632
    Windows 10 Home x64 Version 20H2 Build 19042.928
       #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 07:56.
Find Us




Windows 10 Forums