jessieBoo
asked on
Execute batch script from another server
Server A has batch script on it that I would like to execute from Server B. What is the best way to do this? In c#
I understand that you have a batch file that lives on Server A, I'm a little unclear on where you want it to execute - Server A or Server B?
ASKER
I want to execute the batch script on Server A from Server B.
PSEXEC will not work for me because it will always return error code 1. Internet searches show I’m not the only one having this problem.
PSEXEC will not work for me because it will always return error code 1. Internet searches show I’m not the only one having this problem.
Build Webservice on Server A and call It from Server B
ASKER
Can I use a powershell script?
have the batch script or vbscript on server A check a database every so often..user task scheduler to manage...
On server b if you want to launch write a value to that db with a value "launch"..next time the batch checks that table in five miuntes..it will see value and run...
On server b if you want to launch write a value to that db with a value "launch"..next time the batch checks that table in five miuntes..it will see value and run...
ASKER
Can anyone tell me how to code this in powershell using the invoke command?
you post your question in C# theme.
ASKER
Yes, but I'm doing my own research and it looks like powershell may be an easy solution. I'm not looing for somethin I can find myself on google.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks! your suggestion will work as well.
From ServerB prompt, type psecec \\ServerA -U administrator -P pass -c -f -h c:\myscript.anything