I would like to run a task everytime a user logs on. The task doesn't need to be run as admin. I have the following entry:

    <addScheduledTask>
        <dayOfMonth>1</dayOfMonth>
        <duration></duration>
        <endDate></endDate>
        <interval></interval>
        <name>${taskName}</name>
        <password></password>
        <period>1</period>
        <program>${taskPath}</program>
        <programArguments></programArguments>
        <runAs>${system_username}</runAs>
        <runAsAdmin>0</runAsAdmin>
        <runOnlyIfLoggedOn>0</runOnlyIfLoggedOn>
        <startDate></startDate>
        <startTime></startTime>
        <type>ONLOGON</type>
        <weekDays>*</weekDays>
        <workingDirectory>${installDir}</workingDirectory>
        <ruleList>
            <platformTest>
                <type>windows</type>
            </platformTest>
        </ruleList>
    </addScheduledTask>

When I run the above I always get:

[14:50:08] Scheduling taskName task to run. password cannot be blank Unable to create scheduled task taskName

Do i need to specify a password to schedule a task no matter what? I was hoping that users could schedule a task without any interaction at all.

asked 29 Jan '13, 18:59

meflynn's gravatar image

meflynn
1667
accept rate: 0%


Unfortunately this is how Windows scheduler works and specifying the username requires specifying a password. Please note that when scheduling tasks to be run as certain user from scheduler GUI, specifying password is also required.

You may consider adding the program to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run registry to have it run at startup. For example:

<postInstallationActionList> <registrySet> <key>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run</key> <name>${project.shortName}</name> <type>REG_SZ</type> <value>"${installdir}/myapp.exe"</value> </registrySet> </postInstallationActionList>

link

answered 30 Jan '13, 11:39

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×14
×14
×2

Asked: 29 Jan '13, 18:59

Seen: 1,070 times

Last updated: 30 Jan '13, 11:39