Batch file pasting text

April 24, 2009 at 02:21:46
Specs: Windows Vista
I want to make a batch file paste text into programs like a word document. Is there an easy way to do this?

See More: Batch file pasting text

Report •


#1
April 24, 2009 at 03:10:51
NO

Report •

#2
April 24, 2009 at 11:21:42
you can use SendKeys with vbscript. eg
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "notepad c:\test\file.txt"
WScript.Sleep 100
WshShell.AppActivate "Notepad"
WScript.Sleep 100
WshShell.SendKeys "^{a}"
WScript.Sleep 500
WshShell.SendKeys "^{c}"
WScript.Sleep 500
WshShell.SendKeys "%{F4}"
WScript.Sleep 500
WshShell.Run "write c:\test\file2.txt"
WScript.Sleep 500
WshShell.AppActivate "Writer"
WScript.Sleep 500
WshShell.SendKeys "^{a}"
WScript.Sleep 500
WshShell.SendKeys "^{v}"
WScript.Sleep 500
WshShell.SendKeys "^{s}"
WScript.Sleep 500

alternatively, if you know Perl, you can use the module Win32::Clipboard where it lets you manipulate the clipboard programatically.

Unix Win32 tools | Gawk for Windows


Report •

Related Solutions


Ask Question