Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > PsTools
  New Posts New Posts RSS Feed: Silence Fluffy Garbage Output
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Silence Fluffy Garbage Output

 Post Reply Post Reply Page  12>
Author
Message Reverse Sort Order
spoirier View Drop Down
Newbie
Newbie
Avatar

Joined: 13 June 2007
Location: United States
Online Status: Offline
Posts: 1
Post Options Post Options   Quote spoirier Quote  Post ReplyReply Direct Link To This Post Topic: Silence Fluffy Garbage Output
    Posted: 13 June 2007 at 9:58am
This syntax will kill all screen output:
 
pslist -accepteula Explorer >nul 2>&1
 
This syntax will show the result but not the fluff:
 
pslist -accepteula Explorer 2>nul
 
This syntax will show the fluff but not the result:
 
pslist -accepteula Explorer >nul
 
You can find more information about redirection at:
 
 
Hope you find this useful!
Back to Top
acsdfields View Drop Down
Newbie
Newbie


Joined: 02 January 2007
Online Status: Offline
Posts: 4
Post Options Post Options   Quote acsdfields Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2007 at 11:47am
One alternative not mentioned would be to install cygwin on the machine where you run most of your commands. Cygwin will give you a bash shell, so you get quite a bit more power for scripting. Of course this is not a solution for all problems, but it can make life easier.

Put me down as another vote for adding -q options to all of the tools (not just psexec). Very frustrating to have to filter out the fluff if you want to script something and produce a report based on the success/failure of the commands.



Back to Top
coreyfro View Drop Down
Newbie
Newbie
Avatar

Joined: 26 February 2007
Location: United States
Online Status: Offline
Posts: 6
Post Options Post Options   Quote coreyfro Quote  Post ReplyReply Direct Link To This Post Posted: 28 February 2007 at 2:11pm
I pay tribute by biting my tongue and not complaining about windows.  That way, there may be a supermodel in his future.

Originally posted by Karlchen

Hi, coreyfro.

Glad the old men in the forum could help.

By the way, you may have noticed that I supported your idea to suppress the programme logo - on demand - for scripting purposes. (Do not assume that my support will impress anybody too much ...)
If you launch the programme on the commandline, the programme logo does not do any harm. Consider reading it as the tribute you pay to the programme author.

Ciao,
Karl
Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Online Status: Offline
Posts: 5121
Post Options Post Options   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 28 February 2007 at 12:30pm
Hi, coreyfro.

Glad the old men in the forum could help.

By the way, you may have noticed that I supported your idea to suppress the programme logo - on demand - for scripting purposes. (Do not assume that my support will impress anybody too much ...)
If you launch the programme on the commandline, the programme logo does not do any harm. Consider reading it as the tribute you pay to the programme author.

Ciao,
Karl
Back to Top
coreyfro View Drop Down
Newbie
Newbie
Avatar

Joined: 26 February 2007
Location: United States
Online Status: Offline
Posts: 6
Post Options Post Options   Quote coreyfro Quote  Post ReplyReply Direct Link To This Post Posted: 28 February 2007 at 10:42am
Thanks guys, the ^ trick works.  Learn something new every day.
Back to Top
coreyfro View Drop Down
Newbie
Newbie
Avatar

Joined: 26 February 2007
Location: United States
Online Status: Offline
Posts: 6
Post Options Post Options   Quote coreyfro Quote  Post ReplyReply Direct Link To This Post Posted: 28 February 2007 at 9:06am
Because every time I complain about Microsoft, Gawd kills a supermodel that likes computer nerds.  (Why yes, I am the reason they don't exist.)

BESIDES, the point of STDERR is to, oh, I don't know, output errors?  In an interactive script, don't you think I'd like to see those?  Maybe I should go back in time and suggest "STDBS" so everyone could spew BS from their command line tools, and we can all send it where it's sposta go, straight to the bit bucket.

(Actually, that's not a bad idea, all headers could be sent that way for easy parsing.  Hrm....)

The fact of the matter is, inundating the user with garbage output is short sighted.

I mean, really, why do I need to see this every time I run the program?
PsGetSid v1.43 - Translates SIDs to names and vice versa
Copyright (C) 1999-2006 Mark Russinovich
Sysinternals - www.sysinternals.com

Don't you think I know that?  I downloaded the program, so I know where it's from, and I'm using it to capture sids, so I know what it is.  And a copyright on a commandline tool?  That's like a burka on a stripper.

Even Microsoft isn't bold enough to put copyright information on DIR, and if they did, they at least have a /b option.

This isn't required for the function of the program.  It's fluff.  I'm very anti-fluff.

If you can't tell, I'm a Linux nerd struggling with the "closed source" Windows world.  I could have fixed this by now, otherwise.  In the Windows world, Mark Russinovich is a god for coming up with command line tools.  In the Linux world, we expect more from our gods.

I thank you for disclosing the alternative to my batch program.  This will prove most useful.

Originally posted by Karlchen

Hi, coreyfro.

Why do you blame psgetsid for writing to stderr and why do you not blame cmd.exe for failing to process "2>nul" in your for-loop?!

I personally would not mind a new psgetsid.exe option, e.g. -q - quietly, do not display the programme header info on stderr.

Maybe Mark will read this, like the idea and find the time to implement it. Yet, this decision is up to him.

So for the moment you may need to live with a retarded workaround. (Life is full of workarounds.)

Karl




Edited by coreyfro - 28 February 2007 at 10:40am
Back to Top
namrehto View Drop Down
Senior Member
Senior Member


Joined: 23 June 2005
Location: Scotland
Online Status: Offline
Posts: 3861
Post Options Post Options   Quote namrehto Quote  Post ReplyReply Direct Link To This Post Posted: 27 February 2007 at 4:58am
As Karl says, in such circumstances (e.g. embedded commands) any reserved shell character needs to be escaped (with a preceding ^), i.e.:

( ) < > ^ & |

FWIW, there are one or two useful tools at http://internet.cybermesa.com/~bstewart/index.html, including Shell Scripting Toolkit

HTH
Gil
Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Online Status: Offline
Posts: 5121
Post Options Post Options   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 27 February 2007 at 4:31am

Oh, by the way, you might try your command line this way:

for /f "tokens=1* skip=1" %%i in ('psgetsid %1 ^2^>nul') do set local_user_sid=%%i


Masking the offending characters from the commandline interpreter worked fine for me, used: psgetsid v1.42, WinXP Prof SP1

Karl

Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Online Status: Offline
Posts: 5121
Post Options Post Options   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 27 February 2007 at 4:25am
Hi, coreyfro.

Why do you blame psgetsid for writing to stderr and why do you not blame cmd.exe for failing to process "2>nul" in your for-loop?!

I personally would not mind a new psgetsid.exe option, e.g. -q - quietly, do not display the programme header info on stderr.

Maybe Mark will read this, like the idea and find the time to implement it. Yet, this decision is up to him.

So for the moment you may need to live with a retarded workaround. (Life is full of workarounds.)

Karl


Back to Top
coreyfro View Drop Down
Newbie
Newbie
Avatar

Joined: 26 February 2007
Location: United States
Online Status: Offline
Posts: 6
Post Options Post Options   Quote coreyfro Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2007 at 6:30pm
Alas, i have found a way, but this isn't a nice thing to force your loving lusers to do

for /f "tokens=1* skip=1" %%i in ('shut_up_retarded_psgetsid.bat %1') do set local_user_sid=%%i

Along with shut_up_retarded_psgetsid.bat

@echo off
psgetsid %* 2> nul

This is unnecessary complexity that should disappear.  Please fix it.
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down