Professional Geek
RSS icon Email icon Bullet (black)
  • Command Prompt and the Clipboard

    Filed under “I didn’t know you could do that”.

    Something I discovered recently I thought it was one of those things I’d just missed over the years but after a conversation I had in the office I thought it might be worth sharing here too.

    Normally when working with the command prompt if you want to copy some output you have to switch from the keyboard to the mouse.

    Command

    Which is fine, but if you’re working with the keyboard (because you know, command prompt!) switching between that and the mouse can break your flow, well it does for me.

    Turns out you can redirect output straight to the clipboard by piping to clip.exe

    e.g

    Ping google.com | clip

    The output goes to the clipboard ready for pasting elsewhere.

    This is also particularly useful if the output is long and topamax fills the visible area of the screen.

    This is the output from “DriverQuery”, you’d have hard time copying all of that with the mouse

    Command 2

    Useful thing to know!

    This works in PowerShell too and it’s where I use it most.

  • Useful Commands – CmdKey

    A couple of weeks ago I saw a post on Mark Wilson’s blog talking about CMDKEY. At the time I thought “that’s one to remember” but wondered if I’d ever actually need it

    Turns out today I did!

    CmdKey is used for managing cached credentials

    Someone called today as they were working with the documents on their SharePoint site and the “created by” field was a different user to the one who was actually logged into the PC

    What had happened was when the user had been created they initially didn’t have permissions to access the site so they were presented with a username and password prompt

    image

    They put in a username and password combination that DID have permissions to the site and put the tick in the box for “remember my password”

    So I used the following commands

    CMDKEY /List

    This gave me a list of the cached credentials on this PC

    I found the one I wanted and used

    CMDKEY /Delete:TARGET – where target was the name of the server/site I needed to delete

    I closed the browser and restarted and all was well!

    The CMDKEY command is included on Server 2003 / Server 2008 and Windows Vista but NOT XP

    However, you can copy it from a server 2003 machine onto an XP machine and it’ll work just fine