Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How to capture the contents of the clipboard using the command line?


31 Aug 2013   #1

Windows 7 64bit Professional
 
 
How to capture the contents of the clipboard using the command line?

There are lots of sites discussing how to redirect the output of the command line to the clipboard but nothing covering the opposite. I want to capture a link address I have copied to my clipboard and send it to a command line program, as a variable, in a script. Clip.exe seems to be the only command to deal with the clipboard but it only works the opposite way.

If comparing to Linux I'm looking for the command identical to "clipboard=$(xclip -out)"


My System SpecsSystem Spec
.

31 Aug 2013   #2

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

My System SpecsSystem Spec
31 Aug 2013   #3

Windows 7 32 bit
 
 

Also AutoHotkey has a built in clipboard variable named Clipboard.
To assign clipboard text contents to a variable
MyText := Clipboard

see Clipboard in the help. I recommend AutoHotkey_L variant as it has object/true array support.
My System SpecsSystem Spec
.


31 Aug 2013   #4

Windows 7 64bit Professional
 
 

Hm I'll see what I can do, thanks, although I was hoping for a native solution :/
My System SpecsSystem Spec
31 Aug 2013   #5

Windows 7 32 bit
 
 

Quote   Quote: Originally Posted by xenphor View Post
Hm I'll see what I can do, thanks, although I was hoping for a native solution :/
I suppose you could consider VBScript more "native" than AutoIt or AHK. There's probably a way to do it with VBS I would think. I just don't use it often. But I'm sure you can find sites with VBS code snippets.

edit: another alternative is PowerShell. But I use that even less. I'm not well versed in it.
My System SpecsSystem Spec
31 Aug 2013   #6

Windows 7 64bit Professional
 
 

Unfortunately all I know how to do is combine a few command line programs together in a script.
My System SpecsSystem Spec
03 Sep 2013   #7

Windows 7 32 bit
 
 

I would take a look on boards like softpedia.com and sourceforge.net for free command line clipboard stuff that's more versatile than the MS clip.exe. There's bound to be free ones around.
My System SpecsSystem Spec
Reply

 How to capture the contents of the clipboard using the command line?




Thread Tools



Similar help and support threads for2: How to capture the contents of the clipboard using the command line?
Thread Forum
Solved how do i make a shortcut to clear my clipboard contents General Discussion
command line to delete folder contents Performance & Maintenance
How can I set this via command-line or registry? Customization
Gpedit via command line Performance & Maintenance
Script or command to delete contents of Software Distribution folder? Windows Updates & Activation
Command Prompt - Copy to Clipboard Tutorials
Command Line General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 02:23 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33