Question:
Batch programming question?
Danniel Hill
2012-03-31 19:53:46 UTC
Okay, I create websites and wish to open a single .html document in multiple browsers (Opera, Chrome, Firefox, IE, and Safari) to check for compatibility issues. To do so I have to copy the file path of the .html file and paste into each browser's address bar indivually after opening all of the browsers.
I already use batch programming for opening multiple programs at once using the "start" command.
What I want to do is write a batch program that will do the following:

1) Prompt for a file path (ie. C:\User\Documents\..)
2) Save the file path as a string variable
3) Output string variable into multiple "Start" commands, each targeting a seperate internet browser

my idea was along the lines of:

<-- batch code --><-- assume that str is the variable of the user input -->
@echo off
cd "path of Firefox browser"
start firefox.exe str
cd "path of IE browser"
start iexplore.exe str
cd "path of......... (you get the idea)

I just don't know how to store user input as a string variable or how to recall the string inside another command.

Can anyone help me?
Three answers:
Jake
2012-03-31 20:05:12 UTC
echo off

set /p address=Address:

cd "path of firefox"

firefox "%address%"

cd "path of IE"

Iexplore "%address%"

.....

and so on.
galt_57
2012-04-01 03:17:25 UTC
Hmmm... well I just tried something that seems to work. When you begin your testing go to the current project file folder and right-drag the index.html file (or whatever the entry page is for the website) to the desktop creating a shortcut. Rename that shortcut to something standardized such as "Entry_Link." Then in each browser create an easy to find favorite that points to this "entry_link". You could even make "Entry_Link" your homepage in all of the browsers that you use only for testing purposes.
anonymous
2012-04-01 02:54:44 UTC
Is it better to prepare and prevent than to repair and repent?


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...