Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 704 Vote(s) - 3.57 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windows Task Scheduler doesn't start batch file task

#11
**Wasted a lot of time on this silly issue!**

add a cd command to where your batch file resides at the first line of your batch file and see if it resolves the issue.

cd D:\wherever\yourBatch\fileIs

*TIP: please use absolute paths, relative paths ideally should not be an issue, but scheduler has an difficult time understanding them.*
Reply

#12
For me, the problem was caused by the `.bat` included a `cd` to a network drive. This failed, and then the later call to the program in that network drive did nothing.

I figured this out by adding `> log.txt` in the **Add arguments** field of the **Edit action** window for the task.
Reply

#13
My application failed to start via "Task Scheduler".

The error in "Event Viewer" is: `System.IO.DirectoryNotFoundException`

The "Task Scheduler" tries to run this application with the "SYSTEM" user. The problem was that a "network drive" was not mapped for the "SYSTEM" user. So what I did was, I created a ".bat" file and mapped the "network drive" before starting the application:

net use T: \\172.20.2.215\images
cd C:\MyApplication
start MyApplication.exe

So check your logs first: "Event Viewer" -> Windows Logs -> Application
Reply

#14
My problem was caused by OneDrive. OneDrive was syncing the folder my batch file lived in, and that seems to prevent Task Scheduler from executing it. (Doesn't anyone at MS test this kind of thing?)

Anyway by moving my batch file to a folder that wasn't in OneDrive the batch file could be started by Task Scheduler.
Reply

#15
On a Windows system which supports ```runas```. First, independently run your program by launching it from a command line which was run as that user, like following

```runas /user:<domain\username> cmd```

Then, in that new command line, ```cd``` to the path from where you expect the task launcher to launch your program and type the full arguments, for example.

```cd D:\Scripts\```, then execute

```C:\python27\pthon.exe script.py```

Any errors that are being suppressed by task scheduler should come out to command line output and will make things easier to debug.
Reply

#16
I was running this on a Windows Server OS.
I worked for hours, only to find that the problem was that I had checked the "Run with highest privileges" checkbox. When checked on, it removes all drive mappings. And my .bat file was on the network.

[![enter image description here][1]][1]

[1]:
Reply

#17
Configuration that worked for me:

- **In General tab:** mark radio button - "Run only when user is logged on" ***<= important !***
- **Program/script:** just the path to script without quotes or nothing: C:/tools/script.bat
- **Add arguments:** kept it empty
- **Start in:** kept it empty

In settings, only 2 checkboxes marked:

- Allow task to be run on demand
- if the running task does not end when requested, force it to stop
Reply

#18
I have another reason, why script files (or maybe other types, too) are not run in the Task Scheduler: Unsuitable characters in the filename! Some characters are absolutely valid in the scope of a Windows filesystem, but disliked by the Task Scheduler. My filename used brackets like this: "Cert(renew).cmd", which refused to run. "Cert_renew.cmd" did run!
Reply

#19
I had the same problem and none of the solutions worked. When I checked the history I figured out the issue. I had this warning

> Task Scheduler did not launch task "\TASK_NAME" because instance "{34a206d4-7fce-3895-bfcd-2456f6ed6533}" of the same task is already running.

In the settings tab there is a drop down option for "If the task is already running, then the following rule applies:" and the default is "Do not start a new instance". Change that to "Run a new instance in parallel" or "Stop the existing instance" based on what you actually need to be done.

I know it's an old thread and multiple solutions are good here, this is just what worked for me. Hope it helps.
Reply

#20
This is a old problem and this problem even exists in 2022 in Windows 10 and Windows 11!

I'm using Windows 10 Pro and therefore want to give an **easy and a non technical** way to all the users who want to go with the no-brainer/easy way to execute batch files on windows startup.

**Please note this method is valid only for the users who want to auto execute the batch file(s)/script(s)/executable(s) only after they login to windows.**

Please follow the steps given below

1. Go to Run command and type `shell:Startup` [![Windows Shell Startup Command][2]][2]

2. Now Windows will open the folder of startup. Copy your batch/executable file here in this folder as shown below [![Windows Startup Folder Location][3]][3]

3. Give this file all file user persmissions (though this is not required but just to be fail safe!)[![Give User All File Permissions][1]][1]

4. Restart the system and you'll now see your batch/executable file(s) executing automatically after you login
[![Sample of Command Line Executing after startup][4]][4]

[1]:

[2]:

[3]:

[4]:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through