Running a bat script as a different user

I configured jenkins in windows 2019
It starts as domain\jenkins service
I have configured WindowsServer1 node
What should I do to make the *.bat script on WindowsServer1 run as a different user?

Should the agent on WindowsServer1 be run under the user under which the script is to run?

curl -sO http://node1:8080/jnlpJars/agent.jar
java -jar agent.jar -jnlpUrl http://node1:8080/manage/computer/node1/jenkins-agent.jnlp -secret cb19******************** ****c7f06b71da61 -workDir “c:\jenkins”

Yes, you would want the agent to run as the user you want things to run as on the agent.

I don’t know if we understand each other
I run Jenkins on node1 as domain\jenkins

On WindowsServer1 (agent) I want to run script.bat as WindowsServer1\users1

Do I have an agent
curl -sO http://node1:8080/jnlpJars/agent.jar
java -jar agent.jar -jnlpUrl http://node1:8080/manage/computer/node1/jenkins-agent.jnlp -secret cb19******************** ****c7f06b71da61 -workDir “c:\jenkins”

Run as WindowsServer1\users1 ?

Yes, that is exactly what I was saying. You need to launch the agent as the user you want stuff to run as. So, as you said in your case, run the java command as WindowsServer1\users1, then all processes/scripts/etc. will run as that user on the agent.