troubleshooting Question

scheduled task to run batch script stays open

Avatar of laberet
laberet asked on
Microsoft DOSMicrosoft Legacy OSMicrosoft Server OS
7 Comments1 Solution2669 ViewsLast Modified:
Environment = Windows Server 2008 R2
Scheduled task that runs as the system account
Target is a batch file example.bat
When the task scheduler runs the scheduled task it invokes cmd.exe with the /K switch that leaves the command line open and all child processes that are spawned by example.bat open.

Why is it using the /K switch?  How can I get the task scheduler to spawn the task with the /C switch so it doesn’t leave several orphaned and open processes each time it runs?

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros