running program remotely using psexee is not working well

Hi Experts

I want to run java program on remote machine. for example I want to run the notepad
run the notepad.exe.
I write this command

C:\>psexec \\leonardo -d -s notepad.exe

PsExec v1.97 - Execute processes remotely
Copyright (C) 2001-2009 Mark Russinovich
Sysinternals - www.sysinternals.com


notepad.exe started on leonardo with process ID 624.

C:\>


in the remote computer, there is now notepad process, but I can't  see it on the screen

when I add the -i parameter
I get this error

C:\>psexec \\leonardo -d -i notepad.exe

PsExec v1.97 - Execute processes remotely
Copyright (C) 2001-2009 Mark Russinovich
Sysinternals - www.sysinternals.com


PsExec could not start notepad.exe on leonardo:
No process is on the other end of the pipe.

C:\>

How can I solve it ?

Thanks



aquaswAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

johnb6767Commented:
Dont think you can use the -d and the -i together.......

psexec /?

Note the -d switch description......

" Don't wait for process to terminate (non-interactive)."

0
aquaswAuthor Commented:
I don't use them together.
in the first example I didn't used it, and also in this example I didn't used it and I still get errors ...


C:\>psexec \\leonardo -i -s notepad.exe

PsExec v1.97 - Execute processes remotely
Copyright (C) 2001-2009 Mark Russinovich
Sysinternals - www.sysinternals.com


PsExec could not start notepad.exe on leonardo:
No process is on the other end of the pipe.

C:\>
0
Brian PringleSystems Analyst II, SCM, ERPCommented:
You need to use -i to make it "interactive", which means that it will be visible to the user on the desktop. You need to use the -d switch or else your COMMAND windows session will hang until the user on the other computer ends that process.  

We used to use this program to remotely run programs on other computers in our office, such as starting installations of programs remotely.  We encountered some problems using it with Vista where you had to specify the user to run the program, otherwise the UAC would prevent it from running.  Try the following.

psexec \\leonardo -i -d -u USERNAME notepad.exe

Replace USERNAME with the actual username of an administrative account.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

aquaswAuthor Commented:
Hi

thanks for your answer

that's what I get

C:\>psexec \\leonardo -i -d -u USERNAME notepad.exe

PsExec v1.97 - Execute processes remotely
Copyright (C) 2001-2009 Mark Russinovich
Sysinternals - www.sysinternals.com


PsExec could not start notepad.exe on leonardo:
No process is on the other end of the pipe.

C:\>

I found something interesting ...
I restart the remoted computer, and I didn't conected to it using my remote desktop manager
I called to psexec
C:\>psexec \\leonardo -i -d -u USERNAME notepad.exe

PsExec v1.97 - Execute processes remotely
Copyright (C) 2001-2009 Mark Russinovich
Sysinternals - www.sysinternals.com

notepad.exe started on leonardo with process ID 1232.


and it worked.
when I loged  in using Remote Desktop Manager, the psexec didn't worked. it seems that it's something in the settings of the program
does any know what is it ? and how to fix it ?
I tried with console and without constole ... and it didn't worked.

Thanks
0
Adam LeinssServer SpecialistCommented:
I would try seeing if there is an outdated copy of psexecsvc.exe on the target PC and then remove it.  I was running 1.94 version of pstools and was getting your first result (task listed in taskmgr, but nothing on the desktop).  I then upgraded to 1.97 and got your second result (no pipe).  As soon as I rebooted the target PC and tried your last command again, it worked.
0
Adam LeinssServer SpecialistCommented:
If you are using RDP, you need to specify the session id.
I did a mstsc /console to connect to session 0 on the target PC, then this and it worked:
psexec -s \\computername -d -i 0 notepad.exe

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
aquaswAuthor Commented:
Hi, thanks

There is no psexecsvc.exe file and I am using psexec version 1.97
and I still get the same error message ... still not working
0
aquaswAuthor Commented:
thanks aleinss :)
your answer was really helpful :)
0
Adam LeinssServer SpecialistCommented:
Really can't offer anything else myself.  I just tried mstsc without /console and it looks like session 0 is still used and it still works fine.  I would perhaps try with a different PC.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows XP

From novice to tech pro — start learning today.