mostly easy method to doing this would be like this. its a bit too read however i am just explaining how it works and what each part means so not to have people thinking they are running a bad code.
- Open the Task Scheduler: Press Win + X on your keyboard, and select "Task Scheduler" from the Power User menu.
- Locate the scheduled task you want to modify, and double-click on it to open its properties.
- In the task's properties window, go to the "Actions" tab.
- Select the action associated with the task and click "Edit."
- In the "Edit Action" window, you'll find the "Program/script" field. Instead of directly entering the path to the executable, you'll modify it to include the command-line tool "cmd.exe" along with the necessary parameters.
For example, let's assume your original command was:
C:\data\app\taskname.exe
Replace it with the following:
cmd.exe /c start /b /low /wait C:\data\app\taskname.exe
In the modified command:
cmd.exe: Starts the Command Prompt.
/c: Carries out the command specified by following string and then terminates.
start: Launches a new command prompt window to execute the task.
/b: Starts an application without creating a new Command Prompt window.
/low: Starts the application with low priority. can be swapped out with high normal ect. never Realtime.
/wait: Causes the command prompt to wait until the task is completed before exiting
Please note that while this workaround doesn't require a separate batch script, it still relies on using the command-line tool cmd.exe to achieve the desired result.