1

In the Task Scheduler, I've got a batch script set up to run automatically at system startup. The issue is that the batch script does not run automatically at system startup. But if I right click on the batch script and then click run, it successfully executes.

The settings that the batch script is set to run with are: User account: System Run with highest privileges Configure for Windows 10 Trigger: At startup Action: Start a program Program/script: "C:\Users\M\Documents\Softver\C922 Settings\c922script.bat" Add arguments: c922script.bat Start in: C:\Users\M\Documents\Softver\C922 Settings\

Does anyone know the solution to this? Any help on getting the script to automatically execute at startup would be appreciated.

1

For such easy tasks, you really don't need the task scheduler. In Windows, if you go to the run window (Win-key + R) and type in "shell:startup" it opens a directory.

Every application/program that is present in this directory will be executed every time your PC boots. Simply copying over the script in this folder will achieve what you want.

EDIT: You can also use "shell:common startup" for the "All Users" startup folder.

0

I cant comment yet. Please check "Security options" in Task scheduler and check "Run whether user is logged on or not instead of "Run only when user is logged on". Or change trigger to "At log on" instead of "At startup". When you start a machine you are not logged in any user account, therefore it probably wont start if this is a requirement.

0

Here's a batch script that can self copy itself to the startup folder:

@echo off
if not exist "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\%~nx0" (
  copy "%~f0" "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\"
)
REM Rest of code here.........

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.