Windows 10: Run BAT files as Administrator Do Not Execute - Window Displays for 1 Second and Disappears

Discus and support Run BAT files as Administrator Do Not Execute - Window Displays for 1 Second and Disappears in Windows 10 Network and Sharing to solve the problem; Attempted to execute a BAT file as Administrator that was installed form a third-party website:1 The BAT file was edited for configuration data using... Discussion in 'Windows 10 Network and Sharing' started by Hiwahiro, Sep 29, 2021.

  1. Hiwahiro Win User

    Run BAT files as Administrator Do Not Execute - Window Displays for 1 Second and Disappears


    Attempted to execute a BAT file as Administrator that was installed form a third-party website:1 The BAT file was edited for configuration data using Notepad2 The BAT file extension remained as .BAT as verified in the folder's with "file name extensions enabled"Any assistance is greatly appreciated.

    :)
     
    Hiwahiro, Sep 29, 2021
    #1

  2. windows bat file

    I have a bat file which executes my executable jar file. The first thing the java program does is check to see if a lock exists on a particular file. The reason for this is that I only want 1 instance of my java program running. This works fine if I execute
    my jar file from the command line, ie without a .bat file.

    If I use a .bat file my program starts up fine, but the second time I try and execute the bat file I get the following message.

    "The process cannot access the file because it is being used by another process."

    That message is not from my program, it's from Windows. I don't understand why this is happening. Why is my jar file not executing, how does Windows know my program is trying to access the lock file?
    I cannot allow Windows to reject this call to my program, even though I won't start up a second instance I do need to do something with command line paramters passed into it.
     
    joeschmo_649, Sep 29, 2021
    #2
  3. 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, Sep 29, 2021
    #3
  4. Farzad_K Win User

    Run BAT files as Administrator Do Not Execute - Window Displays for 1 Second and Disappears

    Run a .bat file as Admin During Startup

    Thanks. I have tried that and yet the selection of Run as administrator under the Advanced Properties doesn't seem to stay and the .bat file does not get executed with that level.

    Farzad
     
    Farzad_K, Sep 29, 2021
    #4
Thema:

Run BAT files as Administrator Do Not Execute - Window Displays for 1 Second and Disappears

Loading...
  1. Run BAT files as Administrator Do Not Execute - Window Displays for 1 Second and Disappears - Similar Threads - Run BAT files

  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 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)?
  5. 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...
  6. How to run a .bat file as administrator in startup?

    in Windows 10 Support
    How to run a .bat file as administrator in startup?: Hello. As BitDefender as an ongoing error, I want to run a small "bdfix.bat" at login time. But this .bat file MUST be run as an administrator to work. How do I do that? *Redface 120997
  7. Suddenly can't run bat files as administrator

    in Windows 10 Support
    Suddenly can't run bat files as administrator: New, weird, behavior -- If I right click on a bat file, and Run as Administrator, all I get is a brief flash (perhaps a command window?). Just double clicking on it runs as expected (though not elevated, which is what I need). If I open an elevated command window and run...
  8. Executing the bat file without showing the cmd window?

    in Windows 10 Support
    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: [img] 92109
  9. 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...
  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