I have a Java application which uses CMD to execute a .bat file which creates a file after it runs. The script gets executed successfully in windows 2012, but not in windows 2016! I have granted "Log on as a batch job" user right on both Windows Servers.
In win2016: -If no credential is supplied then the script is run successfully but throws out error that the output file is being used by another process!
-If credential is supplied and if the credential is either domain admin or a local admin, the script does not execute and throws out error 0; also, Windows event log shows cmd error.
-If the credential is supplied as the built-admin, the script is ran successfully without any issue.
What am I missing here? anyone have any idea?