Windows 10: Have a .bat file start up as "run as administrator" in start up.

Discus and support Have a .bat file start up as "run as administrator" in start up. in Windows 10 Support to solve the problem; Hi, Let me start with my setup. In File explorer I have a library called "Start up" . This contains 2 paths: Path 1... Discussion in 'Windows 10 Support' started by Janning, May 20, 2017.

  1. Janning Win User

    Have a .bat file start up as "run as administrator" in start up.


    Let me start with my setup. In File explorer I have a library called "Start up" . This contains 2 paths:
    Path 1
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
    and Path 2
    C:\Users\AJ ANNING\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

    I know the library is setup correct, I've used it for a long time with other .bat files.

    (Note: all screen shots are .jpg files attached and/or at - /ajissues/Windows_errors/bat_file_startup/

    ss1.jpg is the shortcut in the library; ss2.jpg is the literaly .bat file

    currently Path 1 is empty Path 2 contains a .bat shortcut called AOLSTART.BAT
    Which points to ""E:\Google Drive\APPS\BatchJobs\AOLSTART.BAT""
    As seen in ss1.jpg, this short cut is set to "run as administrator"
    The file AOLSTART.BAT is at E:\Google Drive\APPS\BatchJobs\ containing the below:

    cd /
    cd "C:\Users\AJ ANNING\AppData\Local\AOLDesktop"
    start Update.exe --processStart AolDesktop.exe

    timeout 2
    start outlook

    The issue is when I reboot, nothing happens, the shortcut AOLSTART.BAT does not work.
    If I use file explorer and navigate to my startup library and double click AOLSTART.BAT it works fine.
    (Initnally I had to right click, run as adminstrator, else it did nothing, so in
    the properties I set it to run as seen in ss1.jpg).

    I have tried to go directly to AOLSTART.BAT in E:\Google Drive\APPS\BatchJobs\ to set it up
    to run as administrator...this is not an option here? (see ss2.jpg)
    I'm guessing during reboot is may need the shortcut AND the .bar file as "run as administrator"
    even though insticnt tells me, if the shortcut is set up to default run as administrator
    that should cover it ? This may not be the issue, all I want is AOLSTART.BAT to run, please advise.
    thanks AJ

    Have a .bat file start up as "run as administrator" in start up. [​IMG]

    Have a .bat file start up as "run as administrator" in start up. [​IMG]

    Janning, May 20, 2017

  2. Dual Display Backgrounds in Windows 10

    Ah. If you want to run it from a BAT file, add "start " to the beginning
    zachd [MSFT], May 20, 2017
  3. GlennL17 Win User
    Windows 10 Read Only issue

    I am unable to run the .bat file as an administrator, and when I try to use CMD to open it, it also does not run it. I literally am completely unable to run the .bat file in the folder or in any folders, including my desktop.
    GlennL17, May 20, 2017
  4. WOT
    WOT Win User

    Have a .bat file start up as "run as administrator" in start up.

  5. Janning Win User
    Yes the short cut only exists in the Startup library at: (keep in mind the shortcut and .bat are both named AOLSTART.BAT)
    C:\Users\AJ ANNING\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

    I copied the literal .bat file aolstart.bat to the startup library path
    C:\Users\AJ ANNING\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

    This does work at reboot, however, I'd prefer the shortcut work for me, so I can edit the .bat in
    its designated storage area where all my .bat are (E:\Google Drive\APPS\BatchJobs\)
    Janning, May 20, 2017
  6. DavidY Win User
    Is E:\Google Drive a physical drive or something which is created/sync-ed at startup?
    I'm wondering if it tries to run the BAT file before it runs whatever creates that drive, so that E:\Google Drive doesn't exist at that point - could that be happening?

    Personally I would use Task Scheduler to create a task and set a few minutes' delay on it.
    DavidY, May 20, 2017
  7. This is a more reliable path, but you should create a shortcut to BAT, set it to run as admin and place it there.

    %ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup

    Indeed, this is the best option, you can setup a delay, run it as admin in background and etc.
    TairikuOkami, May 20, 2017
  8. Janning Win User

    Have a .bat file start up as "run as administrator" in start up.

    Why do you say one of the paths are more reliable than the other? they are both startups. (I do wonder if one is better than the other..and don't know why it would or would not be). I had tried both paths before opening this thread, neither works with the short cut...both do work with the literal .bat file.
    Funny you mention, task scheduler ...that's exactly what I was doing before reading your reply. It does work in task scheduler doing right click, run. I have not had a chance to reboot and test.
    The two options i'm looking at are "at logon" and "at startup". "at logon" would run the bat everytime I logon...I do not want this.
    Since i only want this to start on a reboot, or cold start...I think "at start up"
    Janning, May 20, 2017
  9. Janning Win User
    Janning, May 20, 2017
  10. DavidY Win User
    I haven't read the batch file to figure out what you're trying to do, but possibly at startup. As there are a lot of tasks which run at startup I sometimes put a delay on when I do this, although I've not had any luck with the option to wait until the computer is idle.
    My tip for the delay is that the dialog box doesn't always allow the delay you want but if you export the task, edit the xml file , and re-import, you can have a delay of, for example, 2 minutes which ostensibly isn't allowed.
    DavidY, May 20, 2017
  11. Janning Win User
    At first I only wanted to have it start AOL, on startup, save me a click or two. Then I decided to have it go ahead and start outlook, Google, and facebook...places I know that some point during the day I will for certain be going. I'm sure I'll add others as time goes by, at least now i have a good template to work with.

    I don't know about you? but, using idle as a trigger for me would never work, as I doubt mine is ever truly "idle". Sounds like for you, the re-import is actually completing a setting the GUI is not doing? I'm by far no tasks scheduler expert at all, but, what little i've dealt with it...I've noticed it had bugs. (back in XP days anyway, surely they've corrected the issue I was having...been too long to tell you details on that one). TWO minutes delay ?, thats an eternity. I'm using some real heavy resource tools (ie Quest's TOAD)...and 15 seconds was plenty enough delay for even TOAD to get sorted out. I can't imagine why you'd need 2 minutes. I'm sure you have good reason...but, if its to wait for something to fire up before continuing ...I'd hate to have to work in that app! Using all Solid state drives really helped out for me. With a SSD, it can do a lot in 10 seconds!.
    Janning, May 20, 2017
  12. DavidY Win User
    I still use a 10 year old laptop, with too much clutter installed over the years happening at startup. (I'm awaiting a driver fix from Microsoft before I can clean install the latest Windows 10 version which should improve things.) This thing has an IDE disk (not even SATA) so it's some way away from an SSD... *Wink
    Mind you I have another newer laptop (but still a spinning disk) where there's still a lot going on at Startup, not helped by the anti-virus I'm using, which seems to aggressively hog system resources.
    DavidY, May 20, 2017
  13. Janning Win User

    Have a .bat file start up as "run as administrator" in start up.

    OH theres your issues!! Current antivirus (they design to run on current fast hardware) and again, your old hardware. Yeah,,, thats all got to "go" !...I have 25 ish PC/NAS/servers etc running 24/7 here. In my opinion, the solid state drive is the biggest advance in the last decade. My laptop..took 4.5 minutes from off - to complete boot. With solid state drive....38 seconds.
    No polite way to put it, as cliche as it are in horse n buggy, delivering phone books to rotary dial phone users LOL!
    Antivirus...HA!, my PC at work, oddly, is bleeding edge tech...but, is at a crawls speed, due to .....antivirus etc. That stuff is a a HOG. Keep in mind I have 25 devices going all the time. Since 1995 I've always had 3+ PC running non stop.
    Now...ask me what I use for antivirus.....I don't, never used it...never will. I know you next question...the answer is...ZERO....I've never had a virus.....
    Janning, Apr 4, 2018

Have a .bat file start up as "run as administrator" in start up.

  1. Have a .bat file start up as "run as administrator" in start up. - Similar Threads - bat file start

  2. Run DLL message at start-up

    in Windows 10 Drivers and Hardware
    Run DLL message at start-up: What can I do with this message: C:users/myname/cnmss/specified module could not be found.
  3. *.bat -files not starting!

    in Windows 10 Gaming
    *.bat -files not starting!: I have a friend that wants to host a Minecraft server for a few friends, and we put "java -Xmx1024M -Xms1024M -jar server.jar nogui" in "Start.bat" in a folder, but nothing happens when we start the file server.jar is also in that folder! He has Java installed and Windows 10...
  4. have taskmgr.exe to run on start up.

    in Windows 10 Customization
    have taskmgr.exe to run on start up.: I want taskmgr.exe to run on all startup
  5. run dll error at start up

    in Windows 10 BSOD Crashes and Debugging
    run dll error at start up: Since I upgraded to Windows 10, ver 1903 I get this error message: "There was a problem starting c:\windows\system32\logiLDA.dll" How do I fix it?
  6. explorer doesnt run on start up

    in Windows 10 Customization
    explorer doesnt run on start up: So I was my internet wasnt working, and I was trying to use the CMD to do some stuff to make it work, only for the CMD to crash everytime I tried to open it. So I read online that in the Registry Editor in Computer\HKEY_CURRENT_USER\Software\Microsoft\Command Processor, if...
  7. Batch File in start up

    in Windows 10 Network and Sharing
    Batch File in start up: I have created a batch file for cleaning up all temporary and unnecessary file which can be run any time. I want to add this file with the startup of windows 10, so that when ever I start the windows, the file will automatically run and clean up my PC. In windows 7, you can...
  8. 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
  9. Normal Start Up OR Selective Start Up

    in Windows 10 Support
    Normal Start Up OR Selective Start Up: Another thread prompted me to have a look see at msconfig. To my surprise I find I'm operating with "Selective Start UP: [img] Only twice has this machine been accessed by someone other than myself, 1. A Microsoft Tech (3rd party) for Office installation and 2. A...
  10. 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...