Executing the bat file without showing the cmd window?

Page 1 of 2 12 LastLast

  1. Posts : 175
    Windows 10 Version 6.2 (Build 9200) Home, 64bit
       #1

    Executing the bat file without showing the cmd window?


    I have a bat file closing a program - Digital Clock close.bat - containing:

    Code:
    taskkill /F /IM digital_clock.exe
    How could I avoid this window to be opened when executing the bat file:
      My Computer

  2. essenbe's Avatar
    Posts : 12,517
    Windows 10 Pro 1903
       #2

    In the first line of your batch file, try @echo off like this

    Code:
    @echo off
    taskkill /F /IM digital_clock.exe
      My Computers

  3. Bree's Avatar
    Posts : 19,104
    10 Home x64 (20H2) (10 Pro on 2nd pc)
       #3

    Right-click on the .bat file, select Properties, on the Shortcut tab select Run: Minimised.
      My Computers


  4. Posts : 175
    Windows 10 Version 6.2 (Build 9200) Home, 64bit
    Thread Starter
       #4

    Thank you very much!

    @echo offtaskkill /F /IM digital_clock.exe
    Unfortunately that does not work, the window pops up, though (without message inside):


    Right-click on the .bat file, select Properties, on the Shortcut tab select Run: Minimised.
    Sorry, I cannot find anything like a shortcut tab or "Run: Minimised:
      My Computer

  5. Bree's Avatar
    Posts : 19,104
    10 Home x64 (20H2) (10 Pro on 2nd pc)
       #5

    Enter said:
    Sorry, I cannot find anything like a shortcut tab or "Run: Minimised:
    Sorry, I tried it out on my machine, but I've just realised I was working on a shortcut to my .bat file, not the .bat file itself.

    Make a shortcut to run the bat file, then you can set the shortcut to run it minimised.
      My Computers


  6. Posts : 175
    Windows 10 Version 6.2 (Build 9200) Home, 64bit
    Thread Starter
       #6

    Yes, I had tried even that without access. So I guesse the code is wrong in the bat file:

    Code:
    taskkill /F /IM C:\Programme\Digital Clock 4\Digital Clock close.bat - Verknüpfung.lnk
      My Computer

  7. f14tomcat's Avatar
    Posts : 53,578
    Multi-boot Windows 10 - RTM, RP, Beta, and Insider
       #7

    Enter said:
    Yes, I had tried even that without access. So I guesse the code is wrong in the bat file:

    Code:
    taskkill /F /IM C:\Programme\Digital Clock 4\Digital Clock close.bat - Verknüpfung.lnk
    What Bree posted does work, all you will see is a brief flicker in the taskbar, no cmd window. When you say "without access", do you mean no permission to run it? Also set the shortcut to run as Admin. Example:

    Executing the bat file without showing the cmd window?-2017-08-25_13h13_31.png
      My Computers

  8. Bree's Avatar
    Posts : 19,104
    10 Home x64 (20H2) (10 Pro on 2nd pc)
       #8

    Enter said:
    Yes, I had tried even that without access. So I guesse the code is wrong in the bat file:

    Code:
    taskkill /F /IM C:\Programme\Digital Clock 4\Digital Clock close.bat - Verknüpfung.lnk
    What is ' Verknüpfung.lnk' (Shortcut.lnk) doing at the end of that code you posted? Your originally said the code was...
    Enter said:
    I have a bat file closing a program - Digital Clock close.bat - containing:

    Code:
    taskkill /F /IM digital_clock.exe
    Right-click on the original .bat file, select 'Send to > Desktop (create shortcut)' then set the shortcut on the desktop to run it minimised. That's how I did it.
      My Computers


  9. Posts : 175
    Windows 10 Version 6.2 (Build 9200) Home, 64bit
    Thread Starter
       #9

    Ah yes, great, now it works, I made a ridiculous / stupid mistake, the wrong file was executed.

    Many thanks for the screenshot, I now have the same settings.
      My Computer

  10. Bree's Avatar
    Posts : 19,104
    10 Home x64 (20H2) (10 Pro on 2nd pc)
       #10

      My Computers


 
Page 1 of 2 12 LastLast

  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:28.
Find Us




Windows 10 Forums