Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I use the PSEXEC to start the java process in local machine. When I run the PSEXEC without any user account it works fine.

c:/>psexec java testclass

But when I run with an user account

c:>psexec -u user -p password java test

It gives me the below error

PsExec could not start java: The system cannot find the file specified

I checked the environemt variable for the the above user and the PATH variable has been properly mapped to the java path. Could any one help me to resolve this issue.

share|improve this question
1  
I would suggest using an absolute path, if at all possible –  Matt Simmons May 17 '10 at 14:52

1 Answer 1

Why not just provide the full path?

e.g.:

psexec -u username -p pw "C:\Program Files\Java\jre6\bin\java.exe" C:\path\test
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.