schtasks: Added support for /f argument in create command.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
4415653f84
commit
a6a5bca509
|
@ -183,6 +183,7 @@ static int create_command(int argc, WCHAR *argv[])
|
|||
{
|
||||
const WCHAR *task_name = NULL, *xml_file = NULL;
|
||||
ITaskFolder *root = NULL;
|
||||
LONG flags = TASK_CREATE;
|
||||
IRegisteredTask *task;
|
||||
VARIANT empty;
|
||||
BSTR str, xml;
|
||||
|
@ -217,6 +218,10 @@ static int create_command(int argc, WCHAR *argv[])
|
|||
task_name = argv[1];
|
||||
argc -= 2;
|
||||
argv += 2;
|
||||
}else if(!strcmpiW(argv[0], f_optW)) {
|
||||
flags = TASK_CREATE_OR_UPDATE;
|
||||
argc--;
|
||||
argv++;
|
||||
}else {
|
||||
FIXME("Unsupported argument %s\n", debugstr_w(argv[0]));
|
||||
return 1;
|
||||
|
@ -245,7 +250,7 @@ static int create_command(int argc, WCHAR *argv[])
|
|||
|
||||
V_VT(&empty) = VT_EMPTY;
|
||||
str = SysAllocString(task_name);
|
||||
hres = ITaskFolder_RegisterTask(root, str, xml, TASK_CREATE, empty, empty,
|
||||
hres = ITaskFolder_RegisterTask(root, str, xml, flags, empty, empty,
|
||||
TASK_LOGON_NONE, empty, &task);
|
||||
SysFreeString(str);
|
||||
SysFreeString(xml);
|
||||
|
|
|
@ -211,6 +211,9 @@ START_TEST(schtasks)
|
|||
r = run_command("schtasks /change /tn wine\\winetest /enable");
|
||||
ok(r == 0, "r = %u\n", r);
|
||||
|
||||
r = run_command("schtasks /create /xml test.xml /f /tn wine\\winetest");
|
||||
ok(r == 0, "r = %u\n", r); /* task already exists, but /f argument provided */
|
||||
|
||||
r = run_command("schtasks /create /xml test.xml /tn wine\\winetest");
|
||||
ok(r == 1, "r = %u\n", r); /* task already exists */
|
||||
|
||||
|
|
Loading…
Reference in New Issue