📎 AI Summary:
The thread discusses creating a batch script to automate opening Wikipedia pages based on user input. The original poster struggles with scripting a command that dynamically inserts user-provided text into a URL. The response provides a clear example of how to prompt for input and open the relevant Wikipedia page in Chrome, offering helpful guidance for implementing this functionality.

Juraj

New Member
Member details
Joined
Feb 5, 2014
Messages
1
Thread Author #1
After a lot of hours of Google search I think that really need your help, because I just learn Batch. I make commands for a .bat file similar .cmd, an improved personal assistent with simplier command of human language and one of his functions would be a websearch on Wikipedia. But now... I've problem to make something like this:

Code:
:what is 'empty field to fill'
start chrome.exe http://en.wikipedia.org/wiki/'filled from first line'
goto start
E.g.:
Code:
:what is 'Adam'
is a pseudo-command because of cmd.exe will open chrome.exe on url: http://en.wikipedia.org/wiki/Adam, also will fill empty part of url

Thanks for any usable advises
 

Last edited:
Solution
To create a batch file that can open a web browser and search for a specific term on Wikipedia, you can follow these steps:
  • Create a batch file with the following code:
    Code:
    @echo off set /p search_term="Enter the search term: " start chrome.exe "http://en.wikipedia.org/wiki/%search_term%"
  • Save this code in a file with a .bat extension (e.g., search_wikipedia.bat).
  • When you run the batch file, it will prompt you to enter the search term. Once you enter the term, it will open Chrome and navigate to the corresponding Wikipedia page for that term. Here's a breakdown of how the code works:
  • @echo off: This command turns off command echoing, which prevents each command from being displayed before it's executed...

WindowsForum AI

AI
Staff member
Robot
Member details
Joined
Mar 14, 2023
Messages
114,124
To create a batch file that can open a web browser and search for a specific term on Wikipedia, you can follow these steps:
  • Create a batch file with the following code:
    Code:
    @echo off set /p search_term="Enter the search term: " start chrome.exe "http://en.wikipedia.org/wiki/%search_term%"
  • Save this code in a file with a .bat extension (e.g., search_wikipedia.bat).
  • When you run the batch file, it will prompt you to enter the search term. Once you enter the term, it will open Chrome and navigate to the corresponding Wikipedia page for that term. Here's a breakdown of how the code works:
  • @echo off: This command turns off command echoing, which prevents each command from being displayed before it's executed.
  • set /p search_term="Enter the search term: ": This line prompts the user to enter a search term and stores it in the variable %search_term%.
  • start chrome.exe "http://en.wikipedia.org/wiki/%search_term%": This command opens Chrome and navigates to the Wikipedia page corresponding to the search term provided by the user. Feel free to adjust the code further to enhance its functionality or tailor it to your specific requirements. Let me know if you need any more help or clarification!
 

Solution