none
win 7 no longer runs a batch file in startup folder

    Question

  • After a recent update from Windows Update, a batch file that used to always run from my startup folder no longer runs at startup. Further, If I run the file manually, it pops up a UAC window before allowing me to run the items in the file. How can I correct this problem?
    • Edited by idigweeds Sunday, October 02, 2011 8:21 PM mispelled word
    Sunday, October 02, 2011 8:20 PM

Answers

  •  

    Here's what I do, though I admit it's a bit of extra work.

    Create a task in Task Scheduler. Since the batch file will be executed only once, set the Trigger to be One Time and the Date and Time of execution to be any time prior to today.

    On the Action tab, choose "Start a program" and select the batch file.

    On the General tab, check "Run with highest privileges".

    Now to execute it. Create a shortcut in the Startup folder with the Target field as follows:

     %windir%\System32\schtasks.exe /run /tn "xxx"  (change xxx to be the name of the task).

    Instead of having a shortcut in the Startup folder execute the task, you could simply have the task Trigger execute at Login instead of One Time. This is a more simple solution. I have found some things that MUST be run from the Startup folder, but a batch file won't be a problem.

    And that's it!

     

    If, you currently get the message "Security Warning - Do you want to open this file?", then you can ignore the above and run the following command:

     ICACLS "yyy" /Setintegritylevel (OI)(CI)M

    where yyy is replaced with the path of the batch file producing the error message. On my system (Windows 7 Pro 64-bit), the command has to be re-executed every 8 hours or it will expire, so I have the command in a batch file which is executed Daily every 8 hours by a Task Scheduler task.

     

     


    Hammer842




    • Edited by Hammer842 Monday, October 03, 2011 5:43 PM
    • Proposed as answer by zhen tan Wednesday, October 12, 2011 4:59 AM
    • Marked as answer by Robinson Zhang Tuesday, November 08, 2011 9:54 AM
    Sunday, October 02, 2011 9:03 PM

All replies

  •  

    Here's what I do, though I admit it's a bit of extra work.

    Create a task in Task Scheduler. Since the batch file will be executed only once, set the Trigger to be One Time and the Date and Time of execution to be any time prior to today.

    On the Action tab, choose "Start a program" and select the batch file.

    On the General tab, check "Run with highest privileges".

    Now to execute it. Create a shortcut in the Startup folder with the Target field as follows:

     %windir%\System32\schtasks.exe /run /tn "xxx"  (change xxx to be the name of the task).

    Instead of having a shortcut in the Startup folder execute the task, you could simply have the task Trigger execute at Login instead of One Time. This is a more simple solution. I have found some things that MUST be run from the Startup folder, but a batch file won't be a problem.

    And that's it!

     

    If, you currently get the message "Security Warning - Do you want to open this file?", then you can ignore the above and run the following command:

     ICACLS "yyy" /Setintegritylevel (OI)(CI)M

    where yyy is replaced with the path of the batch file producing the error message. On my system (Windows 7 Pro 64-bit), the command has to be re-executed every 8 hours or it will expire, so I have the command in a batch file which is executed Daily every 8 hours by a Task Scheduler task.

     

     


    Hammer842




    • Edited by Hammer842 Monday, October 03, 2011 5:43 PM
    • Proposed as answer by zhen tan Wednesday, October 12, 2011 4:59 AM
    • Marked as answer by Robinson Zhang Tuesday, November 08, 2011 9:54 AM
    Sunday, October 02, 2011 9:03 PM
  • Hi,

     

    Please refer following article to run the batch file as admin.

     

    http://superuser.com/questions/71190/running-bat-file-at-startup-as-administrator-in-windows-7

    http://www.sevenforums.com/general-discussion/12936-how-run-batch-file-admin.html

    Notice: Since the websites are not hosted by Microsoft, the links may change without notice. Microsoft does not guarantee the accuracy of these.

    Hope that helps


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    Wednesday, October 12, 2011 5:01 AM