In the Distribution Package if you have LocalSystem account radio button checked and its not working you might need to Run as a specified user.
I have had problems using the exit /b line & am now using exit /B 0 at the end of my batches to exit with a forced success code (note the capital B, which I read somewhere is important)
I believe /b simply exits the command window, but may not pass through the success code.
/B 0 will exit with a success code always, so if you think there could be issues, you should add in an On error line to exit with the code you want to return if it fails.
I always use: EXIT /B %ERRORLEVEL% and I never have issues and it will output the error code not just successful.
Good tip - I actually wasn't aware I could use a variable there. Thanks for the pointer!
Thank you , That worked perfect
Also if you use this script:
REM Adding a local group
net localgroup Administrators dinesh /delete
EXIT /B %ERRORLEVEL%
The sdclient message will show you the if the command of removing the user from the group errorlevel of success (0) or failure (1) in the LMDS console for that Scheduled Task.
Thank you my Friend That worked perfectly,
Thank you Joe Drwiega