Monday, November 30, 2009

Copying the current working directory to the clipboard in PowerShell

To copy the current working directory to the clipboard, use the following command:

(get-location).ToString() | out-clipboard
Or:
(get-location).ToString() | clip

The first method requires the PowerShell Community Extensions. The second requires clip.exe, which is present on Vista (and newer) OSs, or older OSs with some resource kits installed.

Another useful trick is to start Windows Explorer in the current folder:

explorer .

1 comment: