Windows 10: Bat file runs ok up to “Pause -Press any key” which does not exit Lost focus

Discus and support Bat file runs ok up to “Pause -Press any key” which does not exit Lost focus in Windows 10 Gaming to solve the problem; Hi everyone – I have a problem with a bat file and am using a test bat file to figure it out. I am using a test bat that runs OK from C:\test and ends... Discussion in 'Windows 10 Gaming' started by DavidEacott, Aug 13, 2022.

  1. Bat file runs ok up to “Pause -Press any key” which does not exit Lost focus


    Hi everyone – I have a problem with a bat file and am using a test bat file to figure it out. I am using a test bat that runs OK from C:\test and ends with a command prompt window onscreen with Pause/press any key which exits ok. It runs OK when I right click/run from inside Task Scheduler Logon/User is logged on/Highest privileges/win10 and ends with a prompt window onscreen with pause/press any key which exits ok. BUT when I start/restart it, it runs OK and ends with a prompt window onscreen with Pause/press any key which does not work because key presses are not going to the open wi

    :)
     
    DavidEacott, Aug 13, 2022
    #1
  2. sc00VN Win User

    .bat file

    A batch file (.bat extension) is basically a series of commands to be executed by the command-line interpreter. When you open the file, your system runs every command stored in the file from top to bottom, once the final command has been executed, it closes
    itself indicating it has finished its job. However, everything happens so fast you think it closes immediately and that's completely normal.

    If you want the command-line interpreter window to remains open once the last command has been executed, I suggest you do the following:

    - Right click on the .bat file and click on the 'edit' button.

    - It will open a notepad displaying a series of commands.

    - Create a new line by hitting enter after the final text and type in 'pause' without quotes.

    - Save the file and run it. This time the window will remain open.
     
    sc00VN, Aug 13, 2022
    #2
  3. Nikhar_K Win User
    Not getting the prompt to end the run while pressing Ctrl + Break key

    Hi,

    Thank you for writing to Microsoft Community Forums.

    I have tried the steps that you are performing and found that you can press the
    Break key to pause the bat operation and once the operation is paused if you press
    Ctrl + Break key, you will get the prompt to end the operation.

    Hope it helps.

    Please reply with the status of the issue, we will be glad to help you further.

    Nikhar Khare

    Microsoft Community - Moderator
     
    Nikhar_K, Aug 13, 2022
    #3
  4. Bat file runs ok up to “Pause -Press any key” which does not exit Lost focus

    Batch Files Knowledge Base

    [/quote]at the end of your script *Smile Bat file runs ok up to “Pause  -Press any key” which does not exit Lost focus :) Click to expand... What's the point of echoing a press any key message and then suppressing the default one from the pause command?


    Also, a script is a program as well. A program is a set of scheduled activities. ie the programming on a tv station, it's just a list that says this is planned at this moment. In IT jargon people prefer to differentiate between the two, though why overcomplicate it to people who don't understand a batchfile in the first place.



    @SOLARIS, if you want an exe file, why not use an actual programming language? Install visual studio.
     
    DanTheBanjoman, Aug 13, 2022
    #4
Thema:

Bat file runs ok up to “Pause -Press any key” which does not exit Lost focus

Loading...
  1. Bat file runs ok up to “Pause -Press any key” which does not exit Lost focus - Similar Threads - Bat file runs

  2. exit to desktop while pressing any button

    in Windows 10 Gaming
    exit to desktop while pressing any button: While I was playing cyberpunk 2077, it suddenly exited the game and back to the desktop, and I try more several times and only ESC and space bar won't exit the game. How can I solve it? P.S. I am using a Bluetooth 5.1 connection keyboard...
  3. exit to desktop while pressing any button

    in Windows 10 Software and Apps
    exit to desktop while pressing any button: While I was playing cyberpunk 2077, it suddenly exited the game and back to the desktop, and I try more several times and only ESC and space bar won't exit the game. How can I solve it? P.S. I am using a Bluetooth 5.1 connection keyboard...
  4. Bat file runs ok up to “Pause -Press any key” which does not exit Lost focus

    in Windows 10 Software and Apps
    Bat file runs ok up to “Pause -Press any key” which does not exit Lost focus: Hi everyone – I have a problem with a bat file and am using a test bat file to figure it out. I am using a test bat that runs OK from C:\test and ends with a command prompt window onscreen with Pause/press any key which exits ok. It runs OK when I right click/run from inside...
  5. Is it safe to run this bat file?

    in AntiVirus, Firewalls and System Security
    Is it safe to run this bat file?: Spo I was wondering how to get sandbox on windows 10 home and I came across this forum saying that I could run this bat file to try and install it.Enable Windows Sandbox Feature in Windows 10 Home Edition Tutorials tenforums.comThe bat file I downloaded was not blocked by...
  6. Can't run .bat files

    in Windows 10 Support
    Can't run .bat files: I haven't run a .bat file in quite a while, so perhaps I unknowingly did something along the was that prompted this problem. I was trying to run Brinks "Reset_Notification_Area_Icons_Cache.bat", but instead the file opens in my text editor. I disassociated .bat in that text...
  7. Bat Files Won't Run?

    in Windows 10 Gaming
    Bat Files Won't Run?: Basically I'm installing BattlEye for a Steam game and I click the .bat file in the game's subfolder to download it (when I was prompted to download it I clicked no but now I practically need it for most servers), and I download the .bat from the main website and it also...
  8. Trouble running .bat files

    in Windows 10 Support
    Trouble running .bat files: Hi, I'm trying to run .bat files on Windows 10, but it tells me that "This app can't run on your PC". It doesn't matter what I use it for, .bat files just won't run anyway. Are .bat files no longer supported? (ran fine on Windows 7) Any workarounds? I'm no expert on...
  9. bat job started by Task Scheduler does not pause

    in Windows 10 Support
    bat job started by Task Scheduler does not pause: In the last week or so all bat jobs started by Task Scheduler have not paused. Previously, I would find a black CMD window open, waiting for me to hit return to close the window. The following test indicates that the bat job ran, but it did not pause. TEST.BAT time /T >...
  10. Can't Run .Bat Files

    in Windows 10 Support
    Can't Run .Bat Files: I try to run .bat files and the just run in note pad. There is no "open with" option. 48199