send clip board content to text file
Moderator: DosItHelp
send clip board content to text file
Is it possible to send text from the clip board to a text file from a batch file I tried
Clip> C:\Users\user\1.text
But it didn't work is is it possible to do this?
Clip> C:\Users\user\1.text
But it didn't work is is it possible to do this?
Re: send clip board content to text file
Code: Select all
for /f "usebackq tokens=* delims=" %i in (`mshta "javascript:Code(close(new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).Write(clipboardData.getData('Text'))));"`) do @echo %i>C:\Users\user\1.text
Last edited by npocmaka_ on 24 Oct 2015 09:12, edited 1 time in total.
Re: send clip board content to text file
Npocmaka I am sorry but it's not working on my computer note I am running windows Vista don't know if that helps ?
Re: send clip board content to text file
Have you ran this through batch file or from command line?
If you want to run this from batch double the %-es.
If you want to run this from batch double the %-es.
Re: send clip board content to text file
I would like to run it from a batch file but I tried running it through cmd and it didn't work it sent the text type clip /? For usage into the text file.
Last edited by batchcc on 02 Apr 2016 04:31, edited 1 time in total.
Re: send clip board content to text file
batchcc wrote:I would like to run it from a batchance file but I tried running it through cmd and it didn't work it sent the text type clip /? For usage into the text file.
So this is what you have in the clip board - the CLIP help.
Try to copy something else.
Re: send clip board content to text file
No I had copied my question the the clip board and it sent the clip help to the text file instead.
Re: send clip board content to text file
small test:
output :
The ways to access clipboard without external binaries are :
1)"InternetExplorer.Application" activex object through vbscript or jscript and use clipboardData.getData(..) method.Though will require admin permissions to create invisible instance of IE
2)mshta (which is in fact internet explorer) through clipboardData.getData(..) method. Hta window will flash for a moment , though with Code(..) flashing is minimized.
3) with .net and Clipboardclass
Code: Select all
@echo off
echo ##--##|clip
for /f "usebackq tokens=* delims=" %%i in (
`mshta "javascript:Code(close(new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).Write(clipboardData.getData('Text'))));"`
) do (
echo cntent of the clipboard:
echo %%i
)
output :
cntent of the clipboard
##--##
The ways to access clipboard without external binaries are :
1)"InternetExplorer.Application" activex object through vbscript or jscript and use clipboardData.getData(..) method.Though will require admin permissions to create invisible instance of IE
2)mshta (which is in fact internet explorer) through clipboardData.getData(..) method. Hta window will flash for a moment , though with Code(..) flashing is minimized.
3) with .net and Clipboardclass