Windows 10: I can no longer run bat file as Admin (cmd flickers then closes)

Discus and support I can no longer run bat file as Admin (cmd flickers then closes) in Windows 10 Support to solve the problem; I made a working script for my windows to mount and unmount drives and it works but it requires admin permission. right after i made the script i saved... Discussion in 'Windows 10 Support' started by xdarkmario, Jul 31, 2017.

  1. I can no longer run bat file as Admin (cmd flickers then closes)


    I made a working script for my windows to mount and unmount drives and it works but it requires admin permission. right after i made the script i saved it and test it and it was working fine, i tested it about 15 times and it works.
    then i reboot and the script no longer runs as admin anymore if i run int without admin it works but cant carry out the command due to lack of permission and if i try to run as admin the cmd window flickers for a split second and closes. the script is indeed correct and working because if run the bat through the task manager as admin that works just fine. how is this even possible?

    :)
     
    xdarkmario, Jul 31, 2017
    #1
  2. Kotabug Win User

    My Batch File(.bat) is no longer running CMD

    My Batch File(.bat) is no longer running CMD and when i go and change the program and find CMD and or Command Prompt it says that the program that i chose cannot be associated with this file type. Please choose another. I ran CMD with .bat file before, but
    now i can't. I there a solution to this, please?

    Original Title: Set Associations
     
    Kotabug, Jul 31, 2017
    #2
  3. Martmcd Win User
    .bat files

    it depends a little on what the batch file is doing, running from within windows it will open a cmd prompt run the commands and close the command prompt.

    outputs from the commands (including errors) are lost when the batch file finishes and closes the command prompt.

    if it is trying to run something that requires admin privileges, it will simply produce an error that is lost.

    if you are running from a shortcut try cmd /k batchfile.bat
    that should leave the command prompt open when the batchfile terminates
     
    Martmcd, Jul 31, 2017
    #3
  4. I can no longer run bat file as Admin (cmd flickers then closes)

    Caledon Ken, Jul 31, 2017
    #4
  5. Try this: Create shortcut of the bat and set the shortcut to run as admin.
     
    TairikuOkami, Jul 31, 2017
    #5
  6. it took me all day to learn how to wright that batch file yet alone learn how to learn powerscript, thats a whole other level
    Already tried that and it does not work
     
    xdarkmario, Aug 1, 2017
    #6
  7. Try3 Win User
    Are your tests before & after reboot using the exact same conditions? - e.g. both being initiated using a shortcut / both being initiated by Task scheduler / both being initiated by a command entered in an elevated command prompt / both being run by the same user account & the same authorising Admin account

    Denis
     
    Try3, Aug 1, 2017
    #7
  8. I can no longer run bat file as Admin (cmd flickers then closes)

    found the issue, it dosent seem to like "&" in the file name. After removing the "&" the script works again.
     
    xdarkmario, Apr 4, 2018
    #8
Thema:

I can no longer run bat file as Admin (cmd flickers then closes)

Loading...
  1. I can no longer run bat file as Admin (cmd flickers then closes) - Similar Threads - longer run bat

  2. When I run .bat or .cmd files it give me an error.

    in Windows 10 Gaming
    When I run .bat or .cmd files it give me an error.: When ever I run a .bat or .cmd file it give me an error that "Windows cannnot access the specified device, path or file. You may not have appropriate permissions to access this item. I don't want to run them but it is the same with programs too. My account is adminator and I...
  3. When I run .bat or .cmd files it give me an error.

    in Windows 10 Software and Apps
    When I run .bat or .cmd files it give me an error.: When ever I run a .bat or .cmd file it give me an error that "Windows cannnot access the specified device, path or file. You may not have appropriate permissions to access this item. I don't want to run them but it is the same with programs too. My account is adminator and I...
  4. When I run .bat or .cmd files it give me an error.

    in Windows 10 Customization
    When I run .bat or .cmd files it give me an error.: When ever I run a .bat or .cmd file it give me an error that "Windows cannnot access the specified device, path or file. You may not have appropriate permissions to access this item. I don't want to run them but it is the same with programs too. My account is adminator and I...
  5. 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...
  6. 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...
  7. Automatically close CMD window after .bat file finishes?

    in Windows 10 Ask Insider
    Automatically close CMD window after .bat file finishes?: I've got a little batch file I use to open two programs with one shortcut, and while it works, the CMD window remains open until I manually close it. There is an "exit" at the end, and I've googled for solutions for this but none of them worked. @Echo off cd C:\Program...
  8. 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...
  9. File Explorer Closes Immediately as I Open, CMD Does Not Want to Run as Admin, Windows...

    in Windows 10 Network and Sharing
    File Explorer Closes Immediately as I Open, CMD Does Not Want to Run as Admin, Windows...: 1. Laptop was working fine earlier. No new apps were installed. 2. File explorer just closes as I open it. No warning or error message. 3. Right clicking CMD and running it as Admin won't work. 4. Windows won't update. 5. Virus Threat and Protection updates keep on...
  10. Run a .bat file as Admin During Startup

    in Windows 10 Customization
    Run a .bat file as Admin During Startup: Hello, I have a batch file that executes certain commands and one of these commands requires admin privilege. When I place this file in the startup folder the command fails. Right clicking on it and setting it to run as admin doesn't work. I am told scripts can be...

Users found this page by searching for:

  1. command prompt opens then flickers back and forth

    ,
  2. run batch as administrator and it flickers