返回首页

调度任务得到了失败:在C |嗨..

我尽量安排使用Windows API的任务......

当我使用下面的程序,它创建窗口中的任务......

但是,函数返回失败..
我无法找到原因。任务。错误"无法启动"

编码是:

#include "stdafx.h"

#include <stdio.h>

#include <windows.h>

#include <lm.h>

#include <Lmat.h>

#include <AtAcct.h>

int main(int argc, char* argv[])

{

    AT_INFO s;

    LPDWORD  jobid;

    LPBYTE s1;

 



    s.JobTime = 42000000;

    s.DaysOfMonth = 11;

    s.DaysOfWeek = 1;

    s.Flags = JOB_ADD_CURRENT_DATE;

    s.Command = (unsigned short*)"C:\\idle.exe";

    //printf("%s",s.Command);

    char chName[100] = "dharmaraj";

    char chPwd[100] = "dharmaraj";

 



 if(NERR_Success == NetScheduleJobAdd(NULL,(LPBYTE)&s,jobid))

 {

     printf("sucess");

 }

 else

 {

     printf("faliure");

 }

 

    printf("Jobid %d\n",jobid);

    return 0;

}

回答

评论会员: 时间:2