Re: remote machine execution



On Mon, 7 Aug 2006 16:36:47 +0800, "James" wrote in
microsoft.public.windows.server.scripting:

ECHO will always works, BUT if u ever pass parameters to batch file, it will
not work.

Eg remote machine drive contains a batch file
remotemachine.bat
Echo args are : %1 %2 %3

my own local machine i run
psexec \\remotemachine -s <drive>:\remotemachine.bat /AdvCli
"/SLP=smsserver"

results :
Args are: /advcli /slp smsserver

I tried all variants below and still get the same results.

The results i want is :

Args are: /advcli /slp=smsserver

It seems to be a weird parsing feature of CMD.EXE. However, it works
with 4NT (which may be only small solace to you):

$ psexec.exe -s \\host 4NT.exe /c c:\Test\test.cmd /advcli /slp=smsserver

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


ECHO /advcli /slp=smsserver
/advcli /slp=smsserver
4NT.exe exited on host with error code 0.

"Michael Bednarek" wrote in message
news:skldd2dpcm1s9f0kkb0a9p8m7t3r9dbvch@xxxxxxxxxx
On Sun, 06 Aug 2006 22:46:30 -0400, Clay Calvert wrote in
microsoft.public.windows.server.scripting:

On Mon, 7 Aug 2006 08:47:33 +0800, "James" wrote:

The current problem in psexec is they cannot pass "=" sign over to remote
machines.

Try escaping it with a "^".

psexec \\%1 "%remote_drive%:\%remote_dir_install%\Capinst.exe" /AdvCli
/SLP^=smsserver

... or quoting that token.

psexec \\%1 "%remote_drive%:\%remote_dir_install%\Capinst.exe" /AdvCli
"/SLP=smsserver"

Clay,

Did you verify that the "=" sign is not passed? Because here, this
command works:

$ psexec \\host -s cmd.exe /c Echo /AdvCli /SLP=smsserver
PsExec v1.55 - Execute processes remotely
Copyright (C) 2001-2004 Mark Russinovich
Sysinternals - www.sysinternals.com


/AdvCli /SLP=smsserver
cmd.exe exited on host with error code 0.

You suggestion to escape and/or quote works as well:
$ psexec \\tgm69 -s cmd.exe /c Echo /AdvCli /SLP^=smsserver
[...]
/AdvCli /SLP=smsserver
cmd.exe exited on host with error code 0.
and
$ psexec \\tgm69 -s cmd.exe /c Echo /AdvCli "/SLP=smsserver"
[...]
/AdvCli /SLP=smsserver
cmd.exe exited on host with error code 0.
and
$ psexec \\tgm69 -s cmd.exe /c Echo /AdvCli "/SLP^=smsserver"
[...]
/AdvCli /SLP=smsserver
cmd.exe exited on host with error code 0.

That's four working variants.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
.



Relevant Pages

  • Re: Messages stuck in Outbound messages awaiting delivery queue
    ... The only message displayed in the details is "Host ... stuck in the oubound queue. ... >will show you an error code. ... >Please do not send email directly to this alias. ...
    (microsoft.public.exchange.connectivity)
  • Re: remote machine execution
    ... ECHO will always works, BUT if u ever pass parameters to batch file, it will ... cmd.exe exited on host with error code 0. ... That's four working variants. ...
    (microsoft.public.windows.server.scripting)
  • Re: RE: Error Code 81000314
    ... ive had a similar problem b4.....but i forgot the error code. ... i deleted the host address n logged back in msn. ... ive already solved the prob. ...
    (microsoft.public.windowsxp.messenger)
  • Re: remote machine execution
    ... Did you verify that the "=" sign is not passed? ... command works: ... cmd.exe exited on host with error code 0. ...
    (microsoft.public.windows.server.scripting)

Loading