none
code to start google chrome and perform a simple google search RRS feed

  • Question

  • Hi friends

    i need to create a batch file which runs a .vbs script file , so that starts google chrome and automatically performs a search in google search, for example automatically searches the word "book" inside google search.

    thanks in advanced


    Sunday, December 27, 2015 2:19 PM

Answers

  • You probably want the VB Script forum mentioned above.  VBA has to do with MS Office scripting language called VBA (Visual Basic for Applications).  As a side note if you put the following in a file with a .vbs (test.vbs) extension it should work when called from a bat file.  Need to put correct user name.

    Set objShell = CreateObject("WScript.Shell")
    Set objExec = objShell.Exec("C:\Users\<user>\AppData\Local\Google\Chrome\Application\chrome.exe  google.com/#q=book")

    • Marked as answer by john.s2011 Wednesday, January 27, 2016 7:40 PM
    Monday, December 28, 2015 4:57 PM

All replies

  • Why bother with the batch file and the .vbs script file? You can just open the default browser and go a Google search directly from your vb.net application.

    Process.Start("www.google.com/#q=my search term")

    • Proposed as answer by Frank L. Smith Sunday, December 27, 2015 3:17 PM
    Sunday, December 27, 2015 3:13 PM
  • Why bother with the batch file and the .vbs script file? You can just open the default browser and go a Google search directly from your vb.net application.

    Process.Start("www.google.com/#q=my search term")

    Hi Blacjwood. thanks for answer. but i am not a developer and i have not installed Visual studio. 

    i only need the script inside .vbs file & i will call it from a .bat file.

    what would be such script ?

    Sunday, December 27, 2015 9:25 PM
  • This is a VB.Net programming forum,  your question should be asked on a forum for VBS.  Perhaps the link below is where your question should be asked.

    https://social.technet.microsoft.com/Forums/scriptcenter/en-us/home?forum=ITCG


    If you say it can`t be done then i`ll try it

    Sunday, December 27, 2015 9:45 PM
  • Hi John,

    Visual Basic forum is aim to Visual Basic is aim to discuss and ask questions about the Visual Basic programming language. Your question is more related to VBA, I will help you move this thread to VBA forum for dedicated help.

    Best Regards,
    Herro Wong


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 28, 2015 6:52 AM
  • You probably want the VB Script forum mentioned above.  VBA has to do with MS Office scripting language called VBA (Visual Basic for Applications).  As a side note if you put the following in a file with a .vbs (test.vbs) extension it should work when called from a bat file.  Need to put correct user name.

    Set objShell = CreateObject("WScript.Shell")
    Set objExec = objShell.Exec("C:\Users\<user>\AppData\Local\Google\Chrome\Application\chrome.exe  google.com/#q=book")

    • Marked as answer by john.s2011 Wednesday, January 27, 2016 7:40 PM
    Monday, December 28, 2015 4:57 PM
  • You probably want the VB Script forum mentioned above.  VBA has to do with MS Office scripting language called VBA (Visual Basic for Applications).  As a side note if you put the following in a file with a .vbs (test.vbs) extension it should work when called from a bat file.  Need to put correct user name.

    Set objShell = CreateObject("WScript.Shell")
    Set objExec = objShell.Exec("C:\Users\<user>\AppData\Local\Google\Chrome\Application\chrome.exe  google.com/#q=book")

    ok, thanks a lot
    Wednesday, January 27, 2016 7:40 PM