Jump to content

Copy file contents to clipboard on windows


xpmule

Recommended Posts

This tip i have to share can have a few different uses but i will focus on the one i wanted to use..

Ok so i have a browser password management program i started using and i wanted a fast way to copy the master password to my clipboard

so i can just click a link somewhere and then right-click and paste my password into the program.. so i did some google searching..

I found something useful :)

Now i can click a shortcut to open the password manager and then i click another shortcut to auto copy my password to the clipboard.

What i found was an OLD Microsoft .exe that was distributed on an old Windows XP support tools CD.

You need this, (Clip.exe)

http://www.petri.co.il/software/clip.zip

Found on this page,

http://www.labnol.org/software/tutorials/copy-dos-command-line-output-clipboard-clip-exe/2506/

Note: if the link is dead let me know i can upload it somewhere.. it's only 26kb (13kb in a zip file)

So if you want to do what i did you can create a file called String.cmd

and paste inside the following,

@echo offclip < filename.txt

BUT

that will only work if you put the clip.exe and the filename.txt files into your windows folder (then you don't need full path in script)

and then create a shortcut to your new copy.cmd file somewhere.. for example i use a recreation of the Win XP Quicklaunch on Win 7

and i added a shortcut into the menu for my copy command.

Also it doesn't matter what the file name or extension is.. what i did is a created a random named file with a random extension.

I only tested this by using a text file with one string inside so i don't know how well it works for multiple lines etc

If you dropped clip.exe into your windows folder you can get info from the program by holding down the shift key and right-clicking

and then selecting open command windows here.. then when its open, type in

Clip /?

Or

visit the page i linked too earlier for a tutorial example called Copy Command Line Output to Windows Clipboard Directly

Link to comment
Share on other sites


  • Replies 3
  • Views 1.7k
  • Created
  • Last Reply

You can load a file into the Clipboard with an AutoHotKey script.

http://www.autohotkey.com/docs/misc/Clipboard.htm

http://www.autohotkey.com/docs/commands/FileRead.htm

FileRead, Clipboard, C:\test.txt

Save that as an .ahk file and then run the .ahk file to do it.

Or you can bind it to a Hotkey:

#c::FileRead, Clipboard, C:\test.txt

The above would load the file into the Clipboard whenever you push the Win+C key.

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...