Computing.Net > Forums > Programming > PsExec issue in batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

PsExec issue in batch file

Reply to Message Icon

Name: keridbey
Date: January 31, 2008 at 12:16:38 Pacific
OS: WinXP
CPU/Ram: 1.83 Ghz / 1 Gb
Product: Dell
Comment:

I am running PsExec from a batch file to run another batch file on a remote system. Here's the basic line:

C:\Tools\psexec \\xxx.xxx.xxx.xxx -u administrator -p password -i C:\ProgToBeRunRemotely.cmd

Here's what PsExec responds with:

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

P requires Windows NT/2000/XP/2003.

I'm running the batch file on my Windows XP system, and the remote batch file is on a Windows 2000 system. I've run the exact line from the batch file outside of the batch file, and it works, so I know it's not a problem with PsExec, but I'm at a loss as to what in my batch file could be interfering with it. Has anyone ever seen PsExec respond in this manner?



Sponsored Link
Ads by Google

Response Number 1
Name: keridbey
Date: January 31, 2008 at 12:47:05 Pacific
Reply:

Update:

It seems to result from how I'm calling PsExec. I'm running my batchfile from a directory other than C:\Tools; apparently PsExec doesn't care for that. I was hoping to not have to copy PsExec to the %windir% directory; if anyone has any ideas on how to get around this, it'd make me quite happy!


0

Response Number 2
Name: Razor2.3
Date: January 31, 2008 at 15:44:01 Pacific
Reply:

Add this to the start of your command script?

cd c:\tools


0

Response Number 3
Name: keridbey
Date: January 31, 2008 at 16:02:02 Pacific
Reply:

I tried adding that right before the psexec command, but it still didn't like it (gave the same response). I think that since it does work when PsExec is in %windir% I will end up going that route. <sigh> Still, it's a learning experience. :)

Thanks!


0

Response Number 4
Name: klint
Date: February 1, 2008 at 01:48:08 Pacific
Reply:

This is puzzling me. Does it work if you add C:\Tools to your PATH environment variable? Add it to System Variables using Control Panel -> System Properties dialog -> Advanced tab -> Environment Variables button.

Remember to remove psexec.exe from %windir% to test if it works from C:\Tools when it's in the PATH.


0

Response Number 5
Name: keridbey
Date: February 5, 2008 at 08:28:44 Pacific
Reply:

Unfortunately, the wheels of progress necessitated changes to the script right away, and it's been adapted for the %windir% approach. I've been trying to see if I could duplicate the message PsExec was giving me, but so far I haven't been able to (even after writing a little mini-script that was as close to the original as I could get); apparently I've officially left the Twilight Zone. :)

Thanks for your help!


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: PsExec issue in batch file

Date Routines in Batch Files www.computing.net/answers/programming/date-routines-in-batch-files/15590.html

%DATE% in batch files with win98 www.computing.net/answers/programming/date-in-batch-files-with-win98/4007.html

Progress bar in batch file www.computing.net/answers/programming/progress-bar-in-batch-file/14919.html