Page 1 of 2 12 LastLast
  1.    21 May 2017 #1
    Join Date : Oct 2016
    Posts : 57
    Windows 10 Pro, 64 bit

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


    Hi,

    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
    www.aanning.com - /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 admin...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
    Click image for larger version. 

Name:	ss1.jpg 
Views:	1 
Size:	78.3 KB 
ID:	135948Click image for larger version. 

Name:	ss2.jpg 
Views:	2 
Size:	194.5 KB 
ID:	135949
      My ComputerSystem Spec
  2.    21 May 2017 #2
    Join Date : Mar 2017
    Posts : 471
    Win 10 Pro 15063.332 (ex-Insider)
    Last edited by Brink; 21 May 2017 at 08:17. Reason: added tutorial link for more info
      My ComputersSystem Spec
  3.    21 May 2017 #3
    Join Date : Oct 2016
    Posts : 57
    Windows 10 Pro, 64 bit
    Thread Starter

    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\)
      My ComputerSystem Spec
  4.    21 May 2017 #4
    Join Date : Jan 2014
    Posts : 1,391
    Windows 10 Pro (32-bit) 16299.15

    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.
      My ComputerSystem Spec
  5.    21 May 2017 #5
    Join Date : Oct 2014
    Trnava
    Posts : 2,855
    Windows 10.4 Home 1709 x64

    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

    Quote Originally Posted by DavidY View Post
    Personally I would use Task Scheduler to create a task and set a few minutes' delay on it.
    Indeed, this is the best option, you can setup a delay, run it as admin in background and etc.
      My ComputerSystem Spec
  6.    21 May 2017 #6
    Join Date : Oct 2016
    Posts : 57
    Windows 10 Pro, 64 bit
    Thread Starter

    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"
      My ComputerSystem Spec
  7.    21 May 2017 #7
    Join Date : Oct 2016
    Posts : 57
    Windows 10 Pro, 64 bit
    Thread Starter

    I think this is 'it'....I ended up making a much more than "jus start AOL" bat file, it can me seen at:


    http://www.aanning.com/ajissues/Wind...p/aolstart.txt


    not bad for just throwing this together since we begin talking


    Thanks for your help!
      My ComputerSystem Spec
  8.    21 May 2017 #8
    Join Date : Jan 2014
    Posts : 1,391
    Windows 10 Pro (32-bit) 16299.15

    Quote Originally Posted by Janning View Post
    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"
    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.
      My ComputerSystem Spec
  9.    21 May 2017 #9
    Join Date : Oct 2016
    Posts : 57
    Windows 10 Pro, 64 bit
    Thread Starter

    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 ?...wow, 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!.
      My ComputerSystem Spec
  10.    21 May 2017 #10
    Join Date : Jan 2014
    Posts : 1,391
    Windows 10 Pro (32-bit) 16299.15

    Quote Originally Posted by Janning View Post
    TWO minutes delay ?...wow, 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 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...
    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.
      My ComputerSystem Spec

 
Page 1 of 2 12 LastLast


Similar Threads
Thread Forum
Solved When I do a start or a restart in Win 10 I get a "file manager" screen
As the title says, when I reboot or restart (usually with the restart button due to freezes) I go through the log in screens, finally to land on my desktop with my icons, then the "file manager" for my back up drive pops up. I have Win10...
General Support
Can't click on "Check for Updates" "Windows Update settings" on Start
So I have this weird thing happening in my relatively fresh install of Windows 10. Whenever I search for "Check for Updates" or "Windows Update settings" on the search box of the start menu, I get the results that I want but if I press enter or...
Windows Updates and Activation
Solved "File Explorer" button in Start menu is not working
My "File Explorer" button in Start menu is not working. When I press on it nothing happens. Already tried: SFC/scannow, reboot, restart explorer.exe
General Support
Solved Lost "Pin to Start Screen" and other options, can't drag icon to Start
My Start Screen very weird recently. I can't drag icon app to Start, I can't drag to organize app on Start, when I right click on app, only "More" appears, other options just gone, can anyone help me, it's so annoying. 65051 65052
General Support
Solved Win 8.1 Start Screen option still active: "Show start on Sign-in"
Whenever I log-in from hibernate or boot, the start interface shows. I had this enabled in Windows 8.1 (start screen), but now I'm on 10 (no start screen) and it still shows. There is no option to disable it. Is there a registry key to disable...
General Support
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 01:47.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums