If you want the task to run without a user being logged in you need to provide a user for the task to run as. For that you need the options /RU
(for the run-as account) and /RP
(for its password). If the task only needs access to local ressources you can prevent the password from being stored by using the option /NP
(you still need to provide the password once upon task creation, though). The latter option is not available on Windows versions prior to Vista, I think.
Quoting the relevant sections from the output of schtasks /create /?
:
/RU username Specifies the "run as" user account (user context)
under which the task runs. For the system account,
valid values are "", "NT AUTHORITY\SYSTEM"
or "SYSTEM".
For v2 tasks, "NT AUTHORITY\LOCALSERVICE" and
"NT AUTHORITY\NETWORKSERVICE" are also available as well
as the well known SIDs for all three.
/RP [password] Specifies the password for the "run as" user.
To prompt for the password, the value must be either
"*" or none. This password is ignored for the
system account. Must be combined with either /RU or
/XML switch.
/NP No password is stored. The task runs non-interactively
as the given user. Only local resources are available.
Your commandline creation should probably look somewhat like this:
command= "%windir%\system32\schtasks.exe /create" & _
" /sc minute /mo " & minutes & " /tn " & APPNAME & _
" /ru " & username & " /rp " & password & _
" /f /tr ""C:\Windows\System32\wscript.exe '" & _
getAplicationPath & "\" & wscript.ScriptName & "' cron "