views:

311

answers:

2

Hi I am trying to get a batch file to call an executable from the server and login. I have a monitoring program that allows me send and execute the script. OK here goes....

//x3400/NTE_test/test.exe /USER:student password

Now this doesn't work. The path is right because when I type it in at the run menu in xp it works. Then I manually login and the script runs. How can I get this to login and run that exe I need it to?

Part 2: Some of the machines have already logged in with the password saved (done manually). Should I have a command to first clear that password then login?

Thanks for any replies, I appreciate the help

Jake

A: 

Have you looked at the runas command?

Alex K.
A: 

(note: this question probably belongs on serverfault.com or superuser.com)

If the login that needs to happen is the login for the network share, you can have your script do that using the net use command:

net use //x3400/NTE_test /USER:student password
//x3400/NTE_test/test.exe

If the login is something specific to the `test.exe program, then you'll have to find out from its documentation how to pass credentials on the command line.

In either case, you need to consider the security implications of having a user's password in a script. If the user is has an account with the same name and password on the x3400 server as on the machine he's running on (or if the x3400 machine is in the same domain as his machine), there should be no need for him to provide credentials. This might be a better way to handle the password.

Michael Burr