Windows Vista Beta | WinVistaBeta.com - Message | why doesn't this psexec line work please?

January 06, 2009  
Subject: why doesn't this psexec line work please?
Group: microsoft.public.winternals
Date: 5/9/2007 3:43:46 PM
From: "SuperGumby [SBS MVP]" [Email Address Protection]

psexec \\* -i -u DOMAIN\Administrator del %windir%\softwaredistribution

asks me for password then gives

PsExec could not start del:
The parameter is incorrect.



Back
Subject: Re: why doesn't this psexec line work please?
Group: microsoft.public.winternals
Date: 5/9/2007 7:15:55 PM
From: "David H. Lipman" [Email Address Protection]

From: "SuperGumby [SBS MVP]" <not@your.nellie>

| psexec \\* -i -u DOMAIN\Administrator del %windir%\softwaredistribution
|
| asks me for password then gives
|
| PsExec could not start del:
| The parameter is incorrect.
|

For one it is assuming "del %windir%\softwaredistribution" is working on a file not a tree.

--
Dave
http://www.claymania.com/removal-trojan-adware.html
http://www.ik-cs.com/got-a-virus.htm



Back
Subject: Re: why doesn't this psexec line work please?
Group: microsoft.public.winternals
Date: 5/11/2007 12:26:10 PM
From: "Ben Voigt" [Email Address Protection]


"SuperGumby [SBS MVP]" <not@your.nellie> wrote in message
news:OAO5FuokHHA.1220@TK2MSFTNGP03.phx.gbl...
> psexec \\* -i -u DOMAIN\Administrator del %windir%\softwaredistribution
>
> asks me for password then gives
>
> PsExec could not start del:
> The parameter is incorrect.

del is not a program, it is built in to the cmd.exe interpreter. psexec
doesn't have it built it, so you need to ask psexec to run cmd.exe.



Back
Subject: Re: why doesn't this psexec line work please?
Group: microsoft.public.winternals
Date: 5/11/2007 1:38:06 PM
From: "David H. Lipman" [Email Address Protection]

From: "Ben Voigt" <rbv@nospam.nospam>


|
| del is not a program, it is built in to the cmd.exe interpreter. psexec
| doesn't have it built it, so you need to ask psexec to run cmd.exe.
|

Right and the Environmental variable may not be interpreted as well.

Examples:

psexec \\* -i -u DOMAIN\Administrator cmd.exe /c del c:\windows\softwaredistribution\*.* /s

or

psexec \\* -i -u DOMAIN\Administrator cmd.exe /c del c:\winnt\softwaredistribution\*.* /s

--
Dave
http://www.claymania.com/removal-trojan-adware.html
http://www.ik-cs.com/got-a-virus.htm



Back
Subject: Re: why doesn't this psexec line work please?
Group: microsoft.public.winternals
Date: 5/11/2007 3:59:10 PM
From: "SuperGumby [SBS MVP]" [Email Address Protection]

tks Ben, David,

someone else beat me to the punch anyway

http://www.espinola.net/wiki/So_you_want_to_fix_all_your_WSUS_clients

and yes, they're using 'cmd.exe /c' and not relying on the envar.

for my own purposes I'd like to wrap it all up in one script, probably do a
'psexec -c \\* -i -u DOMAIN\Administrator wufix.cmd' instead. I have about a
dozen separate networks to fix. It's only a couple of hundred PC's (2000, XP
and 2003) but if I can figure out the logic should save a little time.

"David H. Lipman" <DLipman~nospam~@Verizon.Net> wrote in message
news:%2331iJxAlHHA.4960@TK2MSFTNGP02.phx.gbl...
> From: "Ben Voigt" <rbv@nospam.nospam>
>
>
> |
> | del is not a program, it is built in to the cmd.exe interpreter. psexec
> | doesn't have it built it, so you need to ask psexec to run cmd.exe.
> |
>
> Right and the Environmental variable may not be interpreted as well.
>
> Examples:
>
> psexec \\* -i -u DOMAIN\Administrator cmd.exe /c del
> c:\windows\softwaredistribution\*.* /s
>
> or
>
> psexec \\* -i -u DOMAIN\Administrator cmd.exe /c del
> c:\winnt\softwaredistribution\*.* /s
>
> --
> Dave
> http://www.claymania.com/removal-trojan-adware.html
> http://www.ik-cs.com/got-a-virus.htm
>
>



Back
Subject: Re: why doesn't this psexec line work please?
Group: microsoft.public.winternals
Date: 5/11/2007 4:08:52 PM
From: "David H. Lipman" [Email Address Protection]

From: "SuperGumby [SBS MVP]" <not@your.nellie>

| tks Ben, David,
|
| someone else beat me to the punch anyway
|
| http://www.espinola.net/wiki/So_you_want_to_fix_all_your_WSUS_clients
|
| and yes, they're using 'cmd.exe /c' and not relying on the envar.
|
| for my own purposes I'd like to wrap it all up in one script, probably do a
| 'psexec -c \\* -i -u DOMAIN\Administrator wufix.cmd' instead. I have about a
| dozen separate networks to fix. It's only a couple of hundred PC's (2000, XP
| and 2003) but if I can figure out the logic should save a little time.
|

The CMD script would have to reside on the remote PC hard disk because network drives would
no be available to the remote process.

If you create a master script that copies that script to the destination PC and then
executes it you got it made.

--
Dave
http://www.claymania.com/removal-trojan-adware.html
http://www.ik-cs.com/got-a-virus.htm



Back
Subject: Re: why doesn't this psexec line work please?
Group: microsoft.public.winternals
Date: 5/11/2007 5:10:14 PM
From: "SuperGumby [SBS MVP]" [Email Address Protection]

my thinking was that 'psexec -c' copies the cmd file to the remote and by
specifying '-u domain\administrator' the cmd then runs in the security
context of the domain admin so network shares are available. naive? (hmmm,
impersonating...)

easy enough for me to test. Maybe that's why Michael has taken his approach.

It's actually getting more complicated by the minute. I'm trying to push a
single cmd to various OS and architecture (x86 vs x64) requiring different
files to be executed. Trying to generalise the script but in reality my
environments don't have some of the variations (eg no x64 Servers).

"David H. Lipman" <DLipman~nospam~@Verizon.Net> wrote in message
news:uJiHZFClHHA.4676@TK2MSFTNGP02.phx.gbl...
> From: "SuperGumby [SBS MVP]" <not@your.nellie>
>
> | tks Ben, David,
> |
> | someone else beat me to the punch anyway
> |
> | http://www.espinola.net/wiki/So_you_want_to_fix_all_your_WSUS_clients
> |
> | and yes, they're using 'cmd.exe /c' and not relying on the envar.
> |
> | for my own purposes I'd like to wrap it all up in one script, probably
> do a
> | 'psexec -c \\* -i -u DOMAIN\Administrator wufix.cmd' instead. I have
> about a
> | dozen separate networks to fix. It's only a couple of hundred PC's
> (2000, XP
> | and 2003) but if I can figure out the logic should save a little time.
> |
>
> The CMD script would have to reside on the remote PC hard disk because
> network drives would
> no be available to the remote process.
>
> If you create a master script that copies that script to the destination
> PC and then
> executes it you got it made.
>
> --
> Dave
> http://www.claymania.com/removal-trojan-adware.html
> http://www.ik-cs.com/got-a-virus.htm
>
>



Back