3
1
I have seen a similar tool CLIP here Clip command but it works into clipboard not the other direction.
I have seen references to "paste" but this doesnt appear to be part of windows. I need to find a solution that works with standard w7 w8 w10 environments.
Clip is distributed. Does anybody a tool that works from clipboard to file?
EDIT Seems it might be possible to do with a powershell command
This C# program I just wrote does what I would to do with a Powershell
class Clip2File
{
[STAThread()]
static void Main(string[] args)
{
var fileName = @"c:\demo.png";
if (args.Length != 0){
fileName = args[0];
}
if (!Clipboard.ContainsImage()) return;
Image img = Clipboard.GetImage();
img?.Save(fileName, ImageFormat.Png);
}
}
looks useful, was just testing c# code if (!Clipboard.ContainsImage()) return; Image img = Clipboard.GetImage(); but very useful to know i could start a powershell to access System.Windows.Forms.Clipboard]::GetImage() I test this soon – phil soady – 2016-03-06T17:03:09.663
The script code (the portion following
-Command
) seems to need to be quoted for this to run under Bash on Ubuntu on Windows. – Kenny Evitt – 2017-07-25T14:06:45.250the Clipboard class is available since .NET 1.1 but somehow when I tried
Powershell -version 2 -command Add-Type -AssemblyName System.Windows.Forms;[System.Windows.Forms.Clipboard]::GetText()
it doesn't run. It only works with version 3 and above – phuclv – 2018-09-04T14:38:19.090