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


  1. Posts : 261
    Windows 10 Enterprise
       #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?
      My Computer


  2. Posts : 30,178
    Windows 11 Pro x64 Version 23H2
       #2

    Hi xdarkmario

    Have a read of this thread. Maybe, just maybe it will help.

    bat job started by Task Scheduler does not pause


    Ken
      My Computer


  3. Posts : 5,452
    Windows 11 Home
       #3

    Try this: Create shortcut of the bat and set the shortcut to run as admin.
      My Computer


  4. Posts : 261
    Windows 10 Enterprise
    Thread Starter
       #4

    Caledon Ken said:
    Hi xdarkmario

    Have a read of this thread. Maybe, just maybe it will help.

    bat job started by Task Scheduler does not pause


    Ken
    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
    TairikuOkami said:
    Try this: Create shortcut of the bat and set the shortcut to run as admin.
    Already tried that and it does not work
      My Computer


  5. Posts : 16,932
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #5

    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
      My Computer


  6. Posts : 261
    Windows 10 Enterprise
    Thread Starter
       #6

    found the issue, it dosent seem to like "&" in the file name. After removing the "&" the script works again.
    Last edited by XDM Inc; 01 Aug 2017 at 23:15.
      My Computer


 

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




Windows 10 Forums