Need little help with .bat file

Status
Not open for further replies.

hq320

Active Member
142
2010
31
10
Hello i was trying to make .bat file that open link+text from clipboard.

Something like this i have made so far, but this wont work.
Eny ideas how can i make it work ?

Code:
@ECHO OFF
SET BROWSER=firefox.exe
START %BROWSER% -new-tab  [URL]https://www.google.fi/search?q=[/URL] |clip

|clip = text from clipboard
 
2 comments
Here you go. This will read the clipboard contents and pass it to the program.
Code:
http://www.autohotkey.com/board/topic/9707-clipread-read-windows-clipboard-cmd/
 
Thanks for your replay.
After 3 hours i find exactly what i was looking for :)

Code:
@echo off
cls
set "path=D:\clip.txt"

>"%temp%\clipboard.vbs" (
   echo.Set objHTML = CreateObject("htmlfile"^)
   echo.ClipboardText = objHTML.ParentWindow.ClipboardData.GetData("text"^)
   echo.path = "%path%"
   echo.Set objFSO = CreateObject("Scripting.FileSystemObject"^)
   echo.Set objFile = objFSO.OpenTextFile(path, 2, true^)
   echo.objFile.WriteLine ClipboardText
   echo.objFile.Close )>>"%temp%\clipboard.vbs"
"%temp%\clipboard.vbs"
del /F /Q %temp%\clipboard.vbs
 
Status
Not open for further replies.
Back
Top