Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

psexec does not seem to work with windows 2003

Posted on 2009-05-15
7
Medium Priority
?
944 Views
Last Modified: 2013-11-17
when running
psexec \\IP -u <username> -p <password> cmd

I get:
cmd exited on <IP> with error code 1

This does not happen on wndows 2008, Vista etc where the cmd runs succesfully..

when I run

psexec \\IP -u <username> -p <password> c:\windows\notepad.exe

It does kick off notepad I can see in the processes.
0
Comment
Question by:it_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 5

Accepted Solution

by:
epochasset earned 750 total points
ID: 24397804
You can run into problems if youve used different verisons of psexec over time.  First, verify you are using the latest version of psexec.  On the 2003 server, check for a left over psexec service via,

sc query | find /i "psexec"

If one is present stop it via 'net stop' and then delete it via 'sc delete %name%', then try running psexec remotely again.

If none of this helps, try remotely executing different programs to see if its all programs in general or just notepad.exe.  Check that on the 2003 server, notepad.exe is in its original form (if its not, consider using sfc.exe to check files).  Also, a virus scan would be standard practice if anything is not working as it normally should (considering that you observed it actually launch notepad).
0
 

Author Comment

by:it_
ID: 24398056

Thanks Epohchasset.

It somehow seems to be only happening with "all" Win 2003 machines all other machines are fine. Using 1.95.
0
 
LVL 5

Expert Comment

by:epochasset
ID: 24399018
Lets try some variations on the psexec usage.

If you want to spawn a gui app like notepad, your going to want to use psexec's -d flag so it doesnt wait for notepad to close on the other end,

psexec \\IP -d -u <username> -p <password> c:\windows\notepad.exe

Also oftentimes you will want to use psexec through the command interpreter like this,

psexec \\IP -u <username> -p <password> cmd.exe "/c c:\windows\notepad.exe"

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:it_
ID: 24399369

Thanks epochasset!

The thing is I m able to kick off a process but not run commands like cmd. And it is *only* on Win2003 boxes. All other environments work just fine. I tried to search quite a bit to see if there is anything specific about 2003. PSEXECSVC seems to run fine on 2003. This is not one machine. Two different machines and a VM with 2003 that I tried 1.95 with and all seem to have the problem i.e.  

when running
psexec \\IP -u <username> -p <password> cmd

I get back:
cmd exited on <IP> with error code 1
0
 
LVL 5

Expert Comment

by:epochasset
ID: 24400857
By chance are the 2003 machines attached to an active directory domain?
0
 

Author Comment

by:it_
ID: 24412013

Thanks for your continuing help.

Yes the 2003 machines are connected to active directory domain..
0
 

Author Closing Comment

by:it_
ID: 31581993
found another solution
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Six Sigma Control Plans

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question