Solved

How to use SCHTASKS in DOS to run a task when user is not logged on

Posted on 2009-07-05
5
2,174 Views
Last Modified: 2013-12-04
I have successfully created a task in DOS to run in the Windows Server 2008 Task Scheduler, using the DOS SCHTASKS command and syntax.

The task runs successfully, but only if I as Administrator am logged in.

If I am not logged in, the task does not run.  Even if I go into Task Scheduler and tell the task to run at the scheduled time whether I am logged in or not, the task does not run.

My guess is that once the task is created in DOS, you cannot edit it in the Task Scheduler without breaking it.

Is there a syntax in DOS that will, upon creating the task, allow the task to run whether the user is logged in or not?
0
Comment
Question by:apitech
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:jfer0x01
ID: 24781880
Hi, Im pretty sure that if your task is a .bat file, the scheduler should have no problem executing

But, make sure to place your user and password on the task scheduler object while making the task

I think, as you are finishing the scheduler wizard, near the end should be an option for "Run As" and place your loggin credentials, this option is also found in the Tasks Screen

Have you tried this?

Jfer
0
 
LVL 9

Expert Comment

by:jfer0x01
ID: 24812806
any advancements?
0
 
LVL 1

Author Comment

by:apitech
ID: 24874532
Here's the scoop.  This cannot be done in Windows Server 2008, since 2008 will not interact with the desktop.
0
 
LVL 1

Accepted Solution

by:
apitech earned 0 total points
ID: 24874536
Here's the scoop.  This cannot be done in Windows Server 2008, since 2008 will not interact with the desktop.
0
 
LVL 9

Expert Comment

by:jfer0x01
ID: 24875496
Ok,

does your user have "Log on as batch jobs" rights?

Does the user have a security entry inside the .bat file in question, for both NTFS and share permissions if necessary?

Is the .bat file in a public folder or a folder readable to the user account?

Did you place Win2003 Compatibility on the Task?

Did you check "Run whether user is logged in or not in the task"?

I did all these things, and it works

What do you mean by interact with Desktop? In what sense?

Jfer
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Security, hackers 10 128
Most secure Linux or x86 Unix that are least prone to ransomware/malware 24 130
Disable SSLv3.0/TLSv1.0 - Windows 2012R2 3 47
Need to disable SSL Cipher 7 154
The term "Bad USB" is a buzz word that is usually used when talking about attacks on computer systems that involve USB devices. In this article, I will show what possibilities modern windows systems (win8.x and win10) offer to fight these attacks wi…
Security measures require Windows be logged in using Standard User login (not Administrator).  Yet, sometimes an application has to be run “As Administrator” from a Standard User login.  This paper describes how to create a shortcut icon to launch a…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question