Few issues.
1)
(unsigned short*)"C:\\idle.exe"
is not how you do Unicode strings. You put an
L
in front of it, like
L"C:\\idle.exe"
2) The final parameter,
jobid
, is an output parameter.
DWORD jobid; NetScheduleJobAdd(NULL,(LPBYTE)&s,&jobid)
This gives it the address of the variable
jobid
, so it can save the output value in it.
1 more thing, you are missing the line feed in the
printf
, so everything is squished up on the one line. Should be
printf("sucess\n");