Re: remote machine execution
- From: Michael Bednarek <ROT13-zo@xxxxxxxxxxxxx>
- Date: Mon, 07 Aug 2006 23:31:36 +1000
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"
.
- References:
- Re: remote machine execution
- From: Michael Bednarek
- Re: remote machine execution
- From: James
- Re: remote machine execution
- From: Clay Calvert
- Re: remote machine execution
- From: James
- Re: remote machine execution
- From: Michael Bednarek
- Re: remote machine execution
- From: James
- Re: remote machine execution
- From: Michael Bednarek
- Re: remote machine execution
- From: James
- Re: remote machine execution
- From: Clay Calvert
- Re: remote machine execution
- From: Michael Bednarek
- Re: remote machine execution
- From: James
- Re: remote machine execution
- Prev by Date: exact copy of files (also deletions) via command line
- Next by Date: Re: exact copy of files (also deletions) via command line
- Previous by thread: Re: remote machine execution
- Next by thread: Re: remote machine execution
- Index(es):
Relevant Pages
|
Loading