Saved Bookmarks
| 1. |
Solve : Copy to clipboard without using clip.exe? |
|
Answer» Hello guys, I've been using this method for a very very long time and got used to it, But then I was wondering if there is another way to copy text to the clipboard without using this file called clip.exe which I always have to carry with it in order to make my batch script work with it. would be nice if some ONE can HELP me. Thanks in advance This works but in modern VERSIONS of windows it asks you if you want to allow it access. Code: [Select] @echo off echo.> %temp%\tmp.vbs set oIE=CreateObject("InternetExplorer.Application") echo.>>%temp%\tmp.vbs oIE.Navigate "about:blank" echo.>>%temp%\tmp.vbs Do Until oIE.ReadyState = 4:wsh.Sleep 50:Loop echo.>>%temp%\tmp.vbs oIE.document.ParentWindow.ClipboardData.SetData _ echo.>>%temp%\tmp.vbs "text", wsh.stdin.readall > %temp%\tmp.txt ECHO aaabbbccc type %temp%\tmp.txt | CSCRIPT //nologo %temp%\tmp.vbs del %temp%\tmp.vbs %temp%\tmp.txt Thanks foxidrive, What I'm really looking for is a way to copy and paste with my batch without the need of clip.exe Now with the script you just posted, the only problem I see is that it involves the use of .vbs script which in Windows 8 all my batch scripts containing .vbs seems to fail. What error do you get? The script above is no good for unattended work anyway, it asks for permission to run it each time. |
|