Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
February 9, 2006
I have scripted PasteClipBoard.bat to paste a text string to the Clipboard.
The syntax for using PasteClipBoard.bat is:
[Call] PasteClipBoard Content
Where Content is the string you want to paste.
PasteClipBoard Hello
PasteClipBoard "Hello world"
PasteClipBoard.bat contains:
@echo offif {%1}=={} @echo Syntax: PasteClipBoard content&goto :EOFif exist "%TEMP%PasteClipBoard.vbs" goto doit@echo Dim objArgs>"%TEMP%PasteClipBoard.vbs"@echo Set objArgs = Wscript.Arguments>>"%TEMP%PasteClipBoard.vbs"@echo Content = objArgs(0)>>"%TEMP%PasteClipBoard.vbs"@echo Set objIE = CreateObject("InternetExplorer.Application")>>"%TEMP%PasteClipBoard.vbs"@echo objIE.Navigate("about:blank")>>"%TEMP%PasteClipBoard.vbs"@echo objIE.document.parentwindow.clipboardData.SetData "text", Content>>"%TEMP%PasteClipBoard.vbs"@echo objIE.Quit>>"%TEMP%PasteClipBoard.vbs":doitcscript //nologo "%TEMP%PasteClipBoard.vbs" %1
You May Also Like