Clipboard As Name v0.4
A "powertoy" for XP, Vista, Windows 7, Windows 8, Server 2003, 2008, 2012, etc..
Those lovely powertoys won't install in Vista or later versions of Windows,
so if you are anything like me, you will miss dragging stuff onto your
"Clipboard As Name" SendTo icon (which you copied to your desktop because it
was sooo handy, right?), something I did about a zillion times a day in XP.
What started out as almost a joke (one single line of code) has actually
transformed into a fairly robust and useful item. After a couple of zillion
successful drag and drop operations (no really, sometimes it's ten zillion
a day!) I feel comfortable recommending it, or a shortcut to it, for *your*
What is it? Too young to remember the Windows PowerToys, huh? Simply put,
you drag stuff onto it, and the path to that stuff is placed into the
system clipboard. If you ever need to type the path to a file or folder,
or many files and folders, ClipbardAsName is what you are looking for.
So here it is, my favourite Windows PowerToy, AutoIt style..
global $Ctrl = false
global $Shift = false
if _IsPressed(11) then $Ctrl = true
if _IsPressed(10) then $Shift = true
if $CmdLine then
global $copy = ""
for $i = 1 to $CmdLine
global $path = $CmdLine[$i]
if $Ctrl then $path = FileGetShortName($path)
if $Shift then
local $UNC_Array = _WinNet_GetUniversalName($path)
$path = $UNC_Array & $UNC_Array
if StringRight($path, 1) = '"' then
$path = StringTrimRight($path, 1)
$path = StringTrimLeft($path, 1)
$copy &= $path & @CRLF
MsgBox(0, "'Clipboard As Name', from corz.org ", "To use: Drag and drop stuff onto me, or a shortcut to me. " & @LF & @LF & _
"The path information will be placed in your system clipboard," & @LF & _
"so you can immediately paste it wherever you need it (Ctrl+V). " & @LF & @LF & _
"Okay, technically, you could also launch me with paths on the " & @LF & _
"command-line, but to save typing, you would first need to get " & @LF & _
"those paths into your clipboard, which is of course, my job! " & @LF & @LF & _
"Hold down the Ctrl key while you drag & drop for the 'short' path. " & @LF & _
"Hold down the Shift key for REAL network path of a mapped resource.")
local $kp = DllCall('user32.dll', "int", "GetAsyncKeyState", "int", '0x' & $Key)
if not @error and BitAND($kp, 0x8000) = 0x8000 then return 1
0.4 Added <SHIFT> to get /real/ UNC paths option.
0.3.2 Added a usage message for if folk click directly on the exe.
Added a 256 pixel icon for Vista desktop usage, so you can sit it next to your trash, and it will
scale all the way up with it (Ctrl+Wheel). Those are the only two icons on my desktop. Looks neat.
I simplified the icon, removing the pencil. I think it works better on your desktop like this, though
doesn't look quite so impressive on a web page. The former I have to look at almost every day!
0.3.1 Fixed Vista problem with paths occasionally losing their last character. (I don't have Vista yet!)
0.3 Added Ctrl key option (8.3 "short" paths)
0.2 Added multiple files capability
0.1 One line of code. cool!