Slashdot Mirror


The Hidden Treasures of Sysinternals

Barence writes "PC Pro contributing editor Jon Honeyball has written a nice feature on the latest treasures to be found on the Windows Sysinternals website. Among them are a tool for creating virtual hard disks from physical drives, a hard disk read-write monitoring tool, and a utility for putting ISO images onto flash drives. They're free, but they're effective."

59 of 356 comments (clear)

  1. pstools best by far by Anonymous Coward · · Score: 2, Informative

    psexec has saved my ass SO many times it's not even funny. psexec \\almostcrashedserver cmd.exe

    1. Re:pstools best by far by afidel · · Score: 4, Informative

      Uh, it hasn't been third party for a long time.

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
  2. Duh by afidel · · Score: 5, Insightful

    There's a reason MS bought the company and hired Mark, he consistently puts out the most useful tools for in the trenches Windows diagnostics. Heck MS's PSS would routinely have you use his tools even before the purchase because nothing they put out internally was nearly as useful.

    --
    There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
    1. Re:Duh by afidel · · Score: 4, Informative

      Nope, it was reborn as the MS diagnostic and recovery toolset. link

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
    2. Re:Duh by Jeng · · Score: 2, Interesting

      And here I thought that Mark got hired to turn Windows Vista into Windows 7. ( I have no idea, but it was my thought at the time that they bought the best kernal hacker out there to redo Vista. )

      Glad to see that not only are Marks old free tools still free, but that Microsoft is allowing new tools of his to be free also. Very un-microsoft of microsoft.

      --
      Don't know something? Look it up. Still don't know? Then ask.
    3. Re:Duh by EvanED · · Score: 3, Interesting

      Heck MS's PSS would routinely have you use his tools even before the purchase because nothing they put out internally was nearly as useful.

      Around the time MS hired Russinovich a lot of people on Slashdot were worried that it would mean the death of Sysinternals's tools, but what you say is why that argument was almost ridiculous: there'd have been open revolt within MS if that went down.

      (I suppose they could have kept the tools internal to MS, but that didn't seem likely.)

    4. Re:Duh by bertok · · Score: 5, Funny

      There's a reason MS bought the company and hired Mark, he consistently puts out the most useful tools for in the trenches Windows diagnostics. Heck MS's PSS would routinely have you use his tools even before the purchase because nothing they put out internally was nearly as useful.

      And the very first thing they did, within mere days of the acquisition, is they took his ultra-efficient, elegant little tools and put a 200KB EULA popup into every one of them.

      A GUI popup.

      Even into the command line tools.

      I threw up in my mouth a little when I saw that.

    5. Re:Duh by Anonymous Coward · · Score: 5, Informative

      Might be a pain, but you can always use the /accepteula command-line switch...

    6. Re:Duh by RAMMS+EIN · · Score: 4, Insightful

      ``And the very first thing they did, within mere days of the acquisition, is they took his ultra-efficient, elegant little tools and put a 200KB EULA popup into every one of them.''

      A fine example of how proprietary software is so much more user-friendly than open-source software.

      ``A GUI popup.

      Even into the command line tools.''

      That, of course, is to make them more user-friendly. Everybody knows the command-line is just for Unix hippies who still live in the 1970s.

      --
      Please correct me if I got my facts wrong.
    7. Re:Duh by riffer · · Score: 2

      Yeah, me too. I was horrified. In fact, as soon as I read that Mark was going to the dark side, I did a full rip of the entire SysInternals website, just to make sure I'd have an untainted copy of all his wonderful, useful Windows tools. I was very glad I did that when I saw Microsoft freaking triple the size of some of the binaries...

      --
      In the darkness of future past, The magician longs to see. One chants between two worlds, "Fire, walk with me!"
    8. Re:Duh by ozmanjusri · · Score: 2, Interesting
      Why are they hidden?

      They're not. This whole article is a marketing puff piece.

      You'll see similar articles all over the web, like "Win 7 cheat code" etc. Windows 7 adoption is slowing, as its honeymoon period ends and the computer buying public realise, despite the intense hype, it's just not a very interesting product. That's why they're touting the phony 10% adoption figure now and not showing any true growth curve.

      --
      "I've got more toys than Teruhisa Kitahara."
    9. Re:Duh by Helen+O'Boyle · · Score: 3, Funny
      Parent wrote the $64,000 question: Why would the exact same list of services running under svchost.exe use different amounts of memory when reported by two different versions of Process Explorer?

      Plausible answer: because one of the versions of Process Explorer has a bug, and the other either does not, or has a different bug.

    10. Re:Duh by 0ld_d0g · · Score: 2, Informative

      bah.. ofcource. The damn tags screwed me over. http://pastebin.com/m622979a6

      Does anyone else thing its sad that a technical site has bugs preventing people from pasting code in comments?

    11. Re:Duh by hairyfeet · · Score: 2, Interesting

      Same here, I figured better safe than sorry. With a full Sysinternals suite on a flash along with the "Computer Repair Utility Toolkit V2" (I'd provide a link but some FOSSies had a fit and made the original website take it down. I'm sure you can find it on MegaUpload) that I update with new AV and antimalware tools it is like having a "shop on a stick" that lets me fix a good 80%+ of the problems I run into on customer's boxes out in the field.

      With those two suites and Dependency Walker on a 2Gb flash stick I can carry all my "save my ass" tools in my pocket, making my life a whole lot easier. I've found we PC repairmen are a lot like plumbers, as when we go to visit friends we often get "Hey, while you are here..." and with the Sysinternals suite and the above tools I can fix most problems in no time flat. So if you read this, thanks Mark, your tools kick ass.

      --
      ACs don't waste your time replying, your posts are never seen by me.
  3. Comment removed by account_deleted · · Score: 5, Funny

    Comment removed based on user account deletion

  4. It's all stuff that ships with Linux by tjstork · · Score: 3, Insightful

    You know, sysinternals was amazing piece of reverse engineering work and some of the utilities that came out of it were pretty interesting as examples of that reverse engineering work.

    But...

    All that stuff is junk compared to what Linux does for utilities!

    I mean, my ubuntu has had burning ISOs and copying them any which way now for at leas 5 years. I can type sensors and get the motherboard temperature, fan speeds, everything. I mean, if you are into doing hardware and low level OS hardware interfacing stuff, there's enough gobblygook in /proc to keep anyone happy from Linux, and then there's all the log files and then the source.

    I mean, yeah, Windows has its advantages, but sysinternals isn't one of them. sysinternals is just proof that for a lot of applications you have to be a hero to get it to do anything simply because the source is closed.

    --
    This is my sig.
    1. Re:It's all stuff that ships with Linux by heffrey · · Score: 4, Insightful

      Let me see if I've got this straight. A great set of tools that run on Windows demonstrates how rubbish Windows is. A great set of tools that run on Linux demonstrates how fantastic Linux is.

      This sounds a bit like Raymond Chen's post today: http://blogs.msdn.com/oldnewthing/archive/2010/02/09/9960102.aspx.

    2. Re:It's all stuff that ships with Linux by Lunix+Nutcase · · Score: 2, Insightful

      At 8-10% penetration? And that's only if you aggregate all Linux based OSes together.

    3. Re:It's all stuff that ships with Linux by Whatsisname · · Score: 3, Insightful

      The tools on sysinternals are tools that should come with windows from day one.

    4. Re:It's all stuff that ships with Linux by Lunix+Nutcase · · Score: 2, Funny

      Why? Most people won't use them. Then what will happen is you same people would be the whining about how Microsoft is "bloating" Windows with all sorts of applications.

    5. Re:It's all stuff that ships with Linux by GerardAtJob · · Score: 2, Interesting

      I hate to say this, but you were generous indeed... (I was hoping for more!!!)

      http://www.canalys.com/pr/2009/r2009112.html

      But.. even 2-3% means many millions of devices... ;)

      --
      I can't call that English ;-)
    6. Re:It's all stuff that ships with Linux by heffrey · · Score: 2, Informative

      Anyone who is capable of using these tools is capable of finding them. Personally, on all machines that I use I copy a folder containing around 200 useful utilities (e.g. grep, ls, cat, cp, bzip2, cpuz, console, depends, ps*, diff, gawk, gzip, less, strings, rapidee, sleep, tar, touch, whoami, whois, zip) and then add it to the path. But, I don't think my mum's going to be using psexec anytime soon.

    7. Re:It's all stuff that ships with Linux by houstonbofh · · Score: 2, Funny

      Yeah. And an image editor - wait, no, 3 image editors a few which work only on the command line. And five word processors. Ten calculators. A utility to write random data to the disk.

      You want MS Word to come for free? That is asking a lot...

    8. Re:It's all stuff that ships with Linux by Pr0xY · · Score: 2, Insightful

      Why compromise and have the installer have a checkbox for "advanced tools?" 99% of people will blindly click next without checking it, they won't get it, the other 1% will actually read what is being asked of them and possibly install it.

      Seems like it would be simple to include it without bloating things at all.

    9. Re:It's all stuff that ships with Linux by mcgrew · · Score: 2, Insightful

      "Bloat" isn't putting apps on a CD you can choose to install or not, it's forcing unnecessary features that few will use in an app or OS.

      IE is bloat, since it's welded to the OS and there are superior alternatives; on most people I know who use windows, it's superflous since they use Firefox.

      IINM these utilities, both in Windows in Linux, aren't mandatory like IE is.

    10. Re:It's all stuff that ships with Linux by 10101001+10101001 · · Score: 2, Insightful

      Let me see if I've got this straight. A great set of tools that run on Windows demonstrates how rubbish Windows is. A great set of tools that run on Linux demonstrates how fantastic Linux is.

      Yep. As pointed out by the GP, the Sysinternal Windows tools are a by-product of reverse engineering. Specifically, they seem to heavily rely upon the Windows Native API (NTAPI) since the Windows 32 subsytem (Win32) wouldn't readily or at all allow them to do what they do. Since the NTAPI is rather undocumented, it was an impressive feat for the utilities to be created.

      However, the fact that an impressive feat was even necessary to obtain Linux-like* parity is the fundamental problem. Doing the same things in Linux are trivial in comparison in most instances because the Linux kernel exposes the information quite freely to user space; and it's generally well documented, so it doesn't even require the semi-heroic effort of understanding the Linux kernel's source code to find out how to use that information or where it is.

      Sysinternals is in many ways a good example of fighting against the system because the system is incomplete. Certainly, there are instances were Linux falls into this problem as well as Windows (most of the video subsystem being outside the kernel for most video cards, for example). And even though the source code is available, that obviously doesn't mean that fixing the problem is a simple matter because even if you create a solution, it doesn't mean others will adopt it and absolve you of a good deal of the upkeep. But, in the end, the heroic struggles (and the melodrama) just doesn't exist when the source is available (or even if there's enough documentation and enough functionality exposed to compensate for where the core system lacks). So, that does tend to ruin the "wow" factor when it comes to anyone announcing software for your platform, since unless the software is a new app of an area you're interested in (which on the whole is uncommon), there aren't any effective OS patches to be created that will likely effect you.

      *Really, any open source OS would do, but I don't know enough about any others to speak about how they function when it comes to kernel/user space things.

      --
      Eurohacker European paranoia, gun rights, and h
    11. Re:It's all stuff that ships with Linux by The+Bungi · · Score: 2, Insightful

      How these tools are used and % of userbase that cares about them:

      Windows:

      - <- Developers
      ------------------- <- Everyone else

      Linux:

      ------------------- <- Developers
      - <- Everyone else

      Do you really think the average office worker cares about examining mount points or finding out how many USER handles a process is using? That's why Microsoft doesn't ship any of that with Windows, and they probably never will. More importantly, I'd rather have a third party write these kinds of tools. They're not limited by what marketing and support think is a good idea to ship. If Microsoft made them they probably wouldn't be as useful - not to mention everyone would whine about how they're evil because they're killing a niche.

      As long as these tools are available, I could care less where I have to get them from or what I couldn't do before I install them. Duh.

    12. Re:It's all stuff that ships with Linux by Quantumstate · · Score: 2, Insightful

      But it still fits on one CD while Windows 7 with much less content somehow manages to fill a DVD.

    13. Re:It's all stuff that ships with Linux by that+this+is+not+und · · Score: 2, Informative

      The Interix package (now called 'Services for Unix' and crippled after Microsoft bought the publisher) runs on the Native API. It's a complete POSIX subsystem that runs alongside the Win32 subsystem, independently.

      If you have real Interix, and not the gimped Microsoft product, you have an entire POSIX subsystem. It isn't like cygwin which is just a kludge that runs out of a Win32 dll file.

      Back in about 1999 when Softway Systems (the creators of Interix) were looking for direction from their market on which way to go, they sent out a questionnaire to customers asking if they should open-source publish the Interix toolchain. Less than a year later they were bought and absorbed into Microsoft.

  5. First? by I_have_a_life · · Score: 5, Informative

    Process Explorer is what Windows should ship with instead of task manager.

    Process Monitor is so kick ass... I can't even put it in words.

    1. Re:First? by Spad · · Score: 2, Insightful

      It's good, but it's not *as* good and it's not a viable direct replacement for Task Manager (not can it easily become one).

    2. Re:First? by Idbar · · Score: 2, Informative

      I start using it, because you were able to run a search of the files used by processes. Particularly, when you're trying to move or delete a file and Windows complains that "something is using the file". Since then, it's a must have on any Windows machine I use.

  6. It's Sysinternals, slashdotters by Anonymous Coward · · Score: 5, Funny

    Not to be confused with the Sisinternals porn website.

    1. Re:It's Sysinternals, slashdotters by Ksevio · · Score: 2, Informative

      So that everyone else doesn't have to check, there isn't actually a porn website called "Sisinternals"...yet.

  7. free BUT effective by Anonymous Coward · · Score: 5, Funny

    > They're free, but they're effective.

    What an unusual combination of attributes!

  8. Putting ISO's onto a usb stick and making bootable by gblackwo · · Score: 3, Informative

    This is very useful- I was one of the people who stuck the Windows 7 MSDNAA downloaded iso onto a flash drive in order to install it to my desktop and laptop.

    The more difficult part for normal users is not extracting the iso to the drive but making the drive bootable- which unless you have a utility (Like the one in the article)- requires some command line work. This would make the process way quicker.

  9. Be careful using the P2V tool. by mbourgon · · Score: 4, Informative

    Tried using it on my box as a backup tool for a clean install of Win7. AVOID IF YOU ARE GOING TO USE THE SAME PHYSICAL DRIVE. Windows 7 couldn't mount or boot it. Known issue, and extremely aggravating.

    --
    "Sometimes a woman is a kind of religion, she can save your soul & set you free from all your sins" - Bad Examples
    1. Re:Be careful using the P2V tool. by klocwerk · · Score: 5, Informative

      It says so in the readme file, and it's a feature not a bug to keep you from hosing your system because you didn't read the readme...

      When you first fire up the new VHD it replaces the disk ID with a new one so that it's unique. This causes much trouble if the computer has two of the same disk ID at the same time when it goes to change one, as you might imagine.

      --

      "You worthless post!"
      -Shakespeare, 2 Gentlemen of Verona, 1. 1. 147
  10. Disk2vhd vs SelfImage by lymond01 · · Score: 3, Interesting

    I used SelfImage recently to dd a windows 2003 box to an LVM-based virtual machine on Proxmox, a Debian-based Virtual Machine Server. Worked a treat. While I see the benefit of created a Microsoft VHD if you're an MS shop, we're a mix so being able to pump a live physical disk into a remote logical volume was great.

  11. disk2vhd by micromuncher · · Score: 2, Informative

    This was a god send to me, after VMWare Converter could not/would not convert a machine of mine, even after registry and driver cleaning, it just failed near the end without a meaningful error message in the log.

    I used disk2vhd, booted up the image in VirtualBox, and bingo - working image.

    --
    /\/\icro/\/\uncher
  12. Free doesn't imply ineffective (and vice-versa) by noidentity · · Score: 4, Insightful

    They're free and they're effective

    There, fixed that for you. Saying "free but effective" suggests that free implies ineffective.

  13. Nothing hidden about them... by syousef · · Score: 5, Informative

    They're excellent for a wide range of things. Filemon (now superceded but still available) is an excellent tool for working out what files a piece of software is opening (eg. if you're trying to find config files). Regmon does something similar for the registry. Process explorer is stellar for getting more detail on a process than task manager will ever give (like where the image is running from and what DLLs it's using). Sysinternals filled a gap in diagnostic software. In a Windows environment they're as basic to me as netstat or ping. (speaking of which check out sysinternals tcpview). Especially good for tracing a user mode process right through. There are a lot of other utils to unlock the power of your Windows environment too.

    Two sysinternals that weren't mentioned worth knowing about:

    streams - view or remove hidden file streams attached to a file not normally seen in explorer. Especially good for removing that pesky "downloaded files are bad" warning when something is marked as being from the Internet zone.

    junction - One of a handful of tools that allows you to create junctions (simliar to but not the same as hard directory links) in Windows XP.

    The other non-sys-internals thing that every power user should know about is windbg and the debugging symbols. Indespesible for tracking down the culprit if you get blue screens due to device drivers (though obviously non-developers are not going to be able to do much about fixing the fault apart from downloading a different version or removing the device driver)

    --
    These posts express my own personal views, not those of my employer
  14. Re:Latest, Really? by fahrbot-bot · · Score: 2, Insightful

    But how exactly is DiskMon a latest treasure?

    Because the PC Pro editor just discovered it and doesn't know any better.

    --
    It must have been something you assimilated. . . .
  15. For speedy access by Spad · · Score: 5, Informative

    Don't forget live.sysinternals.com for instant access to any of the tools.

  16. windowssucks tag? by Angst+Badger · · Score: 2, Insightful

    Well, yes, of course Windows sucks, but the SysInternals package really does mitigate the suckage to a surprising degree. Arguably, it's stuff that should have been part of Windows all along. I've been using it for a couple of years and it has made it much, much easier to beat Windows into submission. It's also extremely useful for finding and removing the crap that virus and malware scanners are apparently incapable of dealing with, as well as finding the mounds of not-actually-temporary temporary files that both Windows and a lot of applications like to consume unreasonable amounts of drive space with.

    --
    Proud member of the Weirdo-American community.
  17. Wonderful tools by Sycraft-fu · · Score: 5, Interesting

    These have been available for a long time, used to just be from a site called Sysinternals run by Russonivich before Microsoft hired him. This guy is, literally, the person who wrote the book on Windows. Windows Internals is the current name, used to be called Inside Windows 2000. A wonderful technical document of the internal workings of Windows.

    At any rate, Russonivich produces extremely useful tools. Not the sort of thing you want in the hands of inexperienced users, as many of them can break your system, but extremely powerful. I use them all the time in the course of my job, especially when there's manual malware removal that needs to be done. So far, malware is unaware of the ability to suspend a process, which Process Explorer will do. So you suspend the malware, its watcher process doesn't know to restart it. You then use autoruns to remove the startup entries. At that point you can reboot, it won't start, and you can clean up the residuals.

    1. Re:Wonderful tools by EvanED · · Score: 2, Insightful

      Don't do that. Go to ctrl panel, administrative tools, services, find the "Windows Update" service (I think that's it's name) in the list, and tell it to stop.

  18. Re:Is time for multidesktop for windows? by strength_of_10_men · · Score: 2, Informative

    The guy behind sysinternals tried to, and was almost a success, but nope.

    Is the failure you're talking about this?

    What are the shortcomings of Sysinternals' Desktops?

    I haven't tried other solutions but I occasionally use this and it works fairly well.

  19. Re:THIS is why I love Windows! by hduff · · Score: 4, Informative

    There is nothing like these tools for any other platform on the market. Mark Russinovich is THE MAN!

    You mean other than UNIX and Linux systems? I don't see any comparable functionality that is not already available on those systems. It's great that the MS environment gets some useful diagnostic funtionality too; sad they haven't always had it.

    --
    "I believe in Karma. That means I can do bad things to people all day long and I assume they deserve it." : Dogbert
  20. Re:Performance Monitor by eeeuh · · Score: 2, Informative

    Maybe you could give atop http://www.atoptool.nl/ a try?
    It shows (per process) disk-IO and nicely integrates cpu/disk/network/io statistics, it can also store statistics for later playback.

    When trying to trace which file is getting a lot of IO you might want to take al look at the filedescriptors in /proc//fd in conjunction with lsof/strace. I Don't know of a nicely integrated tool for that unfortunately.

  21. Re:Whatabout Virtualbox? by MikeDaSpike · · Score: 2, Informative

    It's possible. Create a hardware profile in the vista partition. In that profile change the hard disk controllers to generic ones. Now you can boot your vista partition without any bluescreens. For how to boot it in VB read section 9 of the VBox manual. http://www.virtualbox.org/manual/UserManual.html#rawdisk

  22. Re:the iso to usb tool only accepts win7 isos by interiot · · Score: 4, Interesting

    There are no silver-bullet solutions for booting ISOs via USB. A silver-bullet solution requires doing "floppy emulation", which is something that can't be easily done in a general-purpose way. For CD booting, each BIOS has this functionality implemented differently. For USB booting, the bootloader has to figure out how to do this. MEMDISK and GRUB4DOS are the only ones I know that do floppy emulation.

    But then you have to do CD drive emulation too.

    The way almost all ISO=>USB booters work is to pull the pieces apart and make them work without floppy+CD drive emulation. But this requires intimate knowledge of how that ISO normally boots, and thus it can't be a silver-bullet solution.

  23. A non-sysintenrals thing... but.... by mindstrm · · Score: 2, Interesting

    It's not from sysinternals, but for tiny little utils, Spacemonger - the older version - not the new "installable" one - is absolutely fantastic for finding out where disk-space went..... can't live without it in any windows shop.

  24. Re:Best Buy by zero0ne · · Score: 2, Insightful

    I understand the joke... but lets be serious here, I would be surprised if even 5% of their staff understands how to use these tools correctly.

    When they first started GeekSquad in my area, I was there for a total of 3 months (~15/hr was a good chunk of cash for a college student).

    I saw:

    - people returning towers that ended up having the actual folder we used to document our steps INSIDE the case (surprised the thing didnt overheat)

    - employees trying to remove a power supply without properly unscrewing and detaching the cables from the mobo.

    - managers press their staff to push the ~$70 backup "deal" onto customers (4.7GB of backup no less)

    - a virus on a PC that looked like it filled up the entire hard drive with empty avi files that had a random porn like name given to em.

    - much more I cant recall right now (I've tried to delete it from my memory)

    I stopped showing up shortly after.

  25. "Access Denied" by TheNinjaroach · · Score: 3, Insightful

    Process Explorer kicks the crap out of Task Manager simply for the fact that it doesn't give access denied error messages to admins trying to end protected system processes. Try ending the same processes with Process Explorer and it "just works" -- which goes to show that the Task Manager error message has nothing to do with actual account privileges. The first time I found this I realized it's no wonder Windows has such a problem with malware, the applications I run have more access to my system processes than I do!

    --
    I went to eat some animal crackers and the box said, "Do not eat if seal is broken." I opened the box and sure enough..
  26. Re:Is time for multidesktop for windows? by EvanED · · Score: 2, Insightful

    That's obviously coming from someone who hasn't spend much time with PowerShell.

    I don't make the claim that PS is better (or worse) than the Unix shells, but it does bring a bunch of things to the table that aren't in any common shell. In particular, the ability to pipe objects between processes instead of just text.

    In fact, besides "a capable command line tool", there's really almost nothing that MS took from Unix with PowerShell. (In particular, in some very obnoxious ways it still behaves like cmd.exe, and it still is hosted in the god-awful terminal program that cmd is.)

    For instance, here's the output of 'dir' in PowerShell:

    Mode LastWriteTime Length Name
     
    d---- 12/2/2009 4:48 PM examples-v3
    d---- 12/16/2009 1:40 PM swyx
    -a--- 11/20/2009 2:49 AM 2069 file.dot
    -a--- 11/19/2009 11:22 AM 1461 file.dot~
    ...

    Suppose I want just the name? Under Unix, I'd have to pass some ls-specific flag to get just the name. (Pretend ls worked the opposite it does, and gave long listings by default. This detail doesn't change what I'm saying.) In PowerShell, I just say I want the name field, with dir | select-object name:

    Name
     
    examples-v3
    swyx
    file.dot
    file.dot~
    ...

    I want the name and time it was created? That's dir | select-object Name,CreationTime:

    Name CreationTime
     
    examples-v3 12/2/2009 4:48:55 PM
    swyx 11/2/2009 4:57:30 PM
    file.dot 11/19/2009 11:22:33 AM
    file.dot~ 11/19/2009 11:24:34 AM
    ...

    The same syntax works for other commands. This is get-process | select-object Id,ProcessName:

    Id ProcessName
     
    2956 afscreds
      276 afsd_service
    2664 alg
    3444 ccApp
    1080 ccSvcHst
    1676 cmd
    3020 Console
      376 csrss
    ...

    That's because what 'dir' and 'get-process' actually output is a list of objects, which PowerShell then formats in the table it displays. 'select-object' (I don't claim it's well-named) removes unselected fields from the given objects. 'select-object' (I don't claim it's well-named) removes unselected fields from the given objects.

    (lameness filter blah blah blah... using up some space blah blah blah. Hey, did you hear about the /. poster who got trolled? Oh, that's everyone right.)

  27. Re:Newsid by jtdennis · · Score: 2, Informative

    NewSID does work with Vista, but it was retired last year. Russinovich looked into the common belief of why everyone thought we needed to change the SID and determined that it wasn't necessary. His full post is here

    --
    -- "Freedom is the right of all sentient beings" -Optimus Prime
  28. Re:Is time for multidesktop for windows? by devent · · Score: 4, Insightful

    Oh yes, that's really easier that to type ls -l, ps -ef or ps -ef|grep firefox

    Sorry, but the real advantages in the *nix shells is that every output is just plain simple text. That means, I can grep it, parse it, format it what ever I like and won't be restricted to the PowerShell to do anything use full.

    --
    http://www.mueller-public.de - My site http://www.anr-institute.com/ - Advanced Natural Research Institute
  29. Re:Is time for multidesktop for windows? by EvanED · · Score: 3, Insightful

    Oh yes, that's really easier that to type ls -l, ps -ef or ps -ef|grep firefox

    Okay, now what's your command line for printing just the file name and it's size? (Pretend you can't use 'du' or something like that.) Or just a list of process IDs with their command lines. (Both of these may be possible -- but the point is that the means of doing so isn't discoverable, you have to read the docs. In PowerShell, these operations *are* somewhat discoverable.)

    Besides, I never claimed that PowerShell was better or easier to use than the Unix shells. (I certainly don't claim it's as concise; verbosity is pretty common with Windows API names and such too.) My main claim is that it's merely different -- different enough that to say that it's a copy on anything more than a "hey look, Windows has a half decent command line" level does a disservice to what the PowerShell team did.

    Sorry, but the real advantages in the *nix shells is that every output is just plain simple text. That means, I can grep it, parse it, format it what ever I like and won't be restricted to the PowerShell to do anything use full.

    The fact that "every output is just plain simple text" can very much be a drawback too, because it means that a lot of the time you wind up doing some ad-hoc parsing that often works "well enough" but has problems.

    For instance, take something that I did earlier today for this post: extract from my shell history file a list of the commands I have run so I could sort them and count occurrences.

    My history file has lines that look like this:

    : 1265787576:0;tail zsh-history

    (The first number is the timestamp, the second number is duration.) Give me a command line that will return a list of command names I've run, so that I can then pipe it to "sort | uniq -c | sort -g".

    No really, I'm not kidding; come up with what you would do before reading on.

    My assertion is that this would be trivial in the PowerShell world, if there was a "history" command that would return a list of objects containing, e.g., a CommandPath field. Just 'get-history | select-object CommandPath'.

    What did I do in Linux? This:
    cat zsh-history | cut "-d;" -f2 | cut "-d " -f1
    This isn't so ugly... but it also has a ton of problems:

    • If I had quoted a command name -- say because the path had spaces -- then those quotes wouldn't have been removed for the sort step and would have been counted separately from an unquoted command. Worse, if the path had actually contained spaces, it would have only picked up the path until the first space.
    • Running a command by specifying a full path shows up differently than letting the shell search $PATH for it. Piping through 'basename' or something could fix this -- but at the cost of incorrectly collapsing commands that are in different directories into one entry.
    • I occasionally started a command with an environment variable explicitly set on the command line -- e.g. BLAH=foo cmd. In this case, the output from my pipeline would say the command is BLAH=foo.

    How many of these problems did your solution have?

    (I don't claim that mine is the best possible one -- but I don't know a way to do better without adding *substantial* complexity, and I'm quite comfortable at the command line and at least somewhat conversant with most of the standard Unix utilities.)