0

I have a batch file that looks like this, which takes a picture of a webpage and crops it:

cd C:\users\***\Downloads\IECapt-2008-06-10
IECapt --delay=10000 --url=http://test.com/picture.swf?id=1 --out="C:\users\***\My Documents\picture.png"
cd C:\users\***\My Documents
convert picture.png -trim picture.png

ftp -s:place_img.txt

I was wondering is there was a way that I could alter this script to accept user input to replace the URL and the file name with what the user inputted. For example, the user would input a URL and a file name and it would replace these things:

cd C:\users\***\Downloads\IECapt-2008-06-10
IECapt --delay=10000 --url=(((http://test.com/picture.swf?id=1))) --out="C:\users\***\My Documents\((picture)).png"
cd C:\users\***\My Documents
convert ((picture)).png -trim ((picture)).png

ftp -s:place_img.txt

(((URL being replaced)))

((File name being replaced))

This is the "place_picture.txt" file:

open test.com
username
pass
hash
bin
lcd c:\users\***\My Documents
cd public_html/test.com/test
put picture.png
bye

2 Answers 2

1

I think this batch code works;

@echo off
set /p input=
if %input% == 1 goto ech
:ech
echo Here is your writed text;
echo %input%
pause

set /p input= includes input for batch.

0
0

Two possibilities come to mind. One, you could easily set your batch file to take arguments from the command line, or two, prompt for user input after the user runs the batch file.

I'm not sure how your place_picture.txt relates to the batch file, but I suspect there will need to be some processing done as well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .