Q:

restarting service on a remote server

I'm creating a .bat file to restart a windows service on a remote server. I did some research on this and found 2 ways of executing this. 
1. Using NET START "service"
2. Using SC //server START service
My question is, how do i supply the username and password that's required to login to the remote server? TELNET accepts server and the username, but the password doesn't work.
Any pointers on this?

A:

Got the answer! . Use this before using NET START or SC. 
net use \\server password /USER:user 

Verified..and it worked flawlessly!
More info here: Start And Stop Windows Service remotely using PSEXEC

