I'm using only Notepad++ and not willing to step to something else. (just so nobody advices me to use something else)
I read all about it on the internet that it's possible to copy something to the clipboard, but every single script that I saw has nothing to do with the clipboard in reality.
The example scripts all use IExplore and about:blank and all kinds of stuff that has nothing to do with it.
Some guy explained to me that it needs a parent window to copy something to the clipboard, but in the example script it will not REALLY copy it, it will just write it to the file immediatly, without copying.
strComputer = "." Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMI.ExecQuery _ ("Select * from Win32_Proxy",,48) For Each objItem in colItems ProxyServer = objItem.ProxyServer ProxyPortNumber = objItem.ProxyPortNumber Next Proxy = InputBox("Do you want to save the IP to disk?.","Here's your IP and Port.",""&ProxyServer &":" &ProxyPortNumber,800,600) If Proxy = 1 Then With Clipboard .Clear .SetText(""& ProxyServer) End With msgbox("Copied") Else msgbox("Copy Failed") End If
First block gets data from the WMI engine, the proxy server/IP.
Second block assigns names to specific data in the WMI engine.
Third block creates my inputbox with the wanted text. (The Proxy IP/Port)
The last block will copy the text to the clipboard when the user clicks OK and if the user clicks cancel or exits script.
The error message I get says that the types don't match.