Windows 10: Executing the bat file without showing the cmd window?

Discus and support Executing the bat file without showing the cmd window? in Windows 10 Support to solve the problem; I have a bat file closing a program - Digital Clock close.bat - containing: Code: taskkill /F /IM digital_clock.exe[/quote] How could I avoid this... Discussion in 'Windows 10 Support' started by Enter, Aug 24, 2017.

  1. Enter Win User

    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[/quote] How could I avoid this window to be opened when executing the bat file:

    Executing the bat file without showing the cmd window? [​IMG]


    :)
     
    Enter, Aug 24, 2017
    #1

  2. COMMAND PROMPTS

    Values:

    0 - Disables the Policy. No restriction enforced

    1- Prevent Access to Command Prompt (also blocks .bat/.cmd scritpting abilities)

    2- Prevent Access to Command Prompt (.bat/.cmd scritpting abilities allowed)

    This is a per-user setting.

    Instead you may set NTFS permissions for c:\windows\system32\cmd.exe, and Deny read/execute access for the other user account (your partners 13 year old son). They can't access this file, can't run bat/cmd
    scripts. Console applications still work.

    Accessing Command Prompt, or running .bat/cmd scripts would show the following error:

    [Window Title]

    C:\WINDOWS\system32\cmd.exe

    [Content]

    Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.

    [OK]

    And make sure that other user is a Standard user.
     
    Ramesh Srinivasan, Aug 24, 2017
    #2
  3. nick_24 Win User
    Net Use command does not work in Windows 10

    I am running Win 10 Pro and have a NAS attached to my network.

    I have a set of Net Use commands in a BAT file that fine with Win 7 and Win 8/8.1 pc's on the network

    With Win 10m the BAT file executes with no reported errors, a simple NET USE from a CMD prompt shows the drives are allocated correctly, however from EXPLORER the shaed drives are not accessible.

    Can anyone help? How do I successfully share network storage in windows 10?
     
    nick_24, Aug 24, 2017
    #3
  4. essenbe Win User

    Executing the bat file without showing the cmd window?

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

    Code: @echo off taskkill /F /IM digital_clock.exe[/quote]
     
    essenbe, Aug 24, 2017
    #4
  5. Bree New Member
    Right-click on the .bat file, select Properties, on the Shortcut tab select Run: Minimised.
     
  6. Enter Win User
    Thank you very much!

    Unfortunately that does not work, the window pops up, though (without message inside):

    Executing the bat file without showing the cmd window? [​IMG]


    Sorry, I cannot find anything like a shortcut tab or "Run: Minimised:

    Executing the bat file without showing the cmd window? [​IMG]
     
    Enter, Aug 24, 2017
    #6
  7. Bree New Member
    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.
     
  8. Enter Win User

    Executing the bat file without showing the cmd window?

    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[/quote]
     
    Enter, Aug 24, 2017
    #8
  9. f14tomcat Win User
    [/quote] 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? [​IMG]
     
    f14tomcat, Aug 24, 2017
    #9
  10. Bree New Member
    [/quote] What is ' Verknüpfung.lnk' (Shortcut.lnk) doing at the end of that code you posted? Your originally said the code was...
    [/quote] 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.
     
  11. Enter Win User
    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.
     
    Enter, Aug 24, 2017
    #11
  12. Enter Win User
    Oh no, sorry, it does not work. The windows does not pop up anymore but the program is not closed anymore when I double click the lnk file.

    My settings:


    Executing the bat file without showing the cmd window? [​IMG]


    Execute as admin:

    Executing the bat file without showing the cmd window? [​IMG]


    Content of bat file:

    Code: taskkill /F /IM C:\Programme\Digital Clock 4\Digital Clock schließen.bat - Verknüpfung.lnk[/quote]
    No, I do not, the window keeps popping up.
     
    Enter, Aug 24, 2017
    #12
  13. Enter Win User

    Executing the bat file without showing the cmd window?

    Ah, of course, the wrong code / content, this is correct:
    Code: taskkill /F /IM digital_clock.exe[/quote]
     
    Enter, Aug 24, 2017
    #13
  14. f14tomcat Win User
    [/quote] So now all is ok? It works with the correct code and window does not pop up?
     
    f14tomcat, Aug 24, 2017
    #14
  15. Enter Win User
    Yes, exactly, now it works perfectly, without the window popping up.

    Many thanks!
     
    Enter, Aug 24, 2017
    #15
Thema:

Executing the bat file without showing the cmd window?

Loading...
  1. Executing the bat file without showing the cmd window? - Similar Threads - Executing bat file

  2. Can't execute .bat files.

    in Windows 10 Gaming
    Can't execute .bat files.: As you can see on this video i can't execute bat files. Can someone help me how can i fix it ? Im using windows 11.https://gifyu.com/image/SnaYY https://answers.microsoft.com/en-us/windows/forum/all/cant-execute-bat-files/8cd724f5-a004-48c6-a8a1-37729c652e48
  3. Can't execute .bat files.

    in Windows 10 Software and Apps
    Can't execute .bat files.: As you can see on this video i can't execute bat files. Can someone help me how can i fix it ? Im using windows 11.https://gifyu.com/image/SnaYY https://answers.microsoft.com/en-us/windows/forum/all/cant-execute-bat-files/8cd724f5-a004-48c6-a8a1-37729c652e48
  4. Bat or Cmd file not running at login

    in Windows 10 Gaming
    Bat or Cmd file not running at login: This should be an easy one. Created a net use map drive batch file, also as a cmd. Either one not both, just as a troubleshooting step. File is located on my desktop and if I double click on it, either one it executes as expected and maps the drives. 1st approach was a...
  5. Bat or Cmd file not running at login

    in Windows 10 Software and Apps
    Bat or Cmd file not running at login: This should be an easy one. Created a net use map drive batch file, also as a cmd. Either one not both, just as a troubleshooting step. File is located on my desktop and if I double click on it, either one it executes as expected and maps the drives. 1st approach was a...
  6. 'net use' works in cmd window, not in .bat file

    in Windows 10 Network and Sharing
    'net use' works in cmd window, not in .bat file: Win10 Pro, Version 2004, build 19041.804 (Suggestion to Microsoft- put a 'copy to clipboard' button on the WinVer window). On my home network I have some servers and a couple of NAS drives. (Eight altogether). In startup I call a batch file to map them using 'net use'. Most...
  7. .bat files cannot be executed (Windows 10)?

    in Windows 10 Software and Apps
    .bat files cannot be executed (Windows 10)?: I want to run a .bat file that will allocate more ram to my Minecraft server. I receive the following message. Please ask questions :D [ATTACH] [ATTACH] .bat Dateien lassen sich nicht ausführen (Windows 10)?
  8. Pin .cmd/bat files to taskbar

    in Windows 10 Ask Insider
    Pin .cmd/bat files to taskbar: Some UWP apps look very out of place on my taskbar and I wanted to change the icons. The only way I found looking instead of editing in MS Visual Studio was to make a run command and that opens the app. However, I can't pin it to the taskbar. I tried .bat but that didn't work...
  9. Need some Help with CMD and .bat files

    in Windows 10 Ask Insider
    Need some Help with CMD and .bat files: I have .bat file thats in a folder in my desktop (location). When i open the bat file i need it to run in the folder that's it's located (in the folder thats on my desktop) However, when i run the bat file it runs at the default location. So isn't there anyway I can change...
  10. Executing a .bat file on CMD

    in Windows 10 Support
    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...