Page 1 of 1

Scheduling a task without password

Posted: Sat Mar 27, 2004 6:06 pm
by jkeck
I need to schedule a task for a user. I know what their username is, but I don't know what their password is. Is there a way I can schedule a task without this piece of information? I have not been able to figure it out. I am currently using the trial version of this product, and I will be buying it if I can get this to work!

Posted: Sun Mar 28, 2004 5:37 am
by isiticov
If user has password then task should has it as well in order to run. But it is not possible to detect the user password. So you may try to configure tasks to be executed without account information. So just set account and password to empty values and then it should be possible to execute task.
Hope this helps.

Posted: Mon Mar 29, 2004 12:13 pm
by jkeck
Hello, thank you for your prompt response. When I set account and password to empty values, the scheduled task is not able to run. Is there something I am missing? I am using Win XP.

Posted: Tue Mar 30, 2004 8:13 am
by isiticov
It is highly recommended to use non-empty account name and password as only
in this case a task runs under existing account, allows user input, and has
access rights corresponding to its account. However, it is possible to
schedule a task with empty account and password. This task would run under
SYSTEM account. Note, in order to schedule such a task you must run your
application under Administrator account! Another important point is if you
set blank account/password your task must be scheduled WITHOUT the flag
tfRunOnlyIfLoggedOn. So the setting account information might look as
follows:

Code: Select all

...
if (Trim(wsAccount) = EmptyStr) and (Trim(wsPassword) = EmptyStr) then
  FTask.Flags := FTask.Flags - [tfRunOnlyIfLoggedOn]
else
  FTask.Flags := FTask.Flags + [tfRunOnlyIfLoggedOn];
FTask.SetAccountInformation(wsAccount, wsPassword);
...