Computing.Net > Forums > Programming > Create batch file prompt

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Create batch file prompt

Reply to Message Icon

Name: remgu
Date: May 3, 2007 at 07:53:30 Pacific
OS: Windows XP SP2
CPU/Ram: P4 3.4Ghz 1GB Ram
Product: Clone
Comment:

Mechanix2Go has been kind enough to provide the following syntax.

Does anyone know what syntax needs to be added so that the .prt file below is prompted for? The filename is the only thing that is not constant so right now one has to open the .bat file and manually change the file name and then execute the file.

::==
@echo off

cd c:\ftp_temp

> my.ftp echo o 192.168.1.1
>> my.ftp echo johndoe
>> my.ftp echo password
>> my.ftp echo bin
>> my.ftp echo cd audit_dumps
>> my.ftp echo get file001.prt
>> my.ftp echo bye

ftp -s:my.ftp
::==

Thanks,
REMGU




Response Number 1
Name: IVO
Date: May 3, 2007 at 08:28:14 Pacific
+1
Reply:

@echo off
:LOOP
Set /P prtfile=Enter .prt file name (without ext)^>
Echo File name is %prtfile%
Set /P answ=Enter Y to proceed or you are prompted again^>
If /I not "%answ%."=="Y." GoTo :LOOP
cd c:\ftp_temp

> my.ftp echo o 192.168.1.1
>> my.ftp echo johndoe
>> my.ftp echo password
>> my.ftp echo bin
>> my.ftp echo cd audit_dumps
>> my.ftp echo get %prtfile%.prt
>> my.ftp echo bye
Set prtfile=
Set answ=
ftp -s:my.ftp
::End_Of_Batch

If /I... GoTo :LOOP fits just ONE line.




Response Number 2
Name: remgu
Date: May 3, 2007 at 10:21:40 Pacific
+1
Reply:

WOW! Thanks IVO!

Thanks,
REMGU



Reply to Message Icon

Related Posts

See More


Log file from Batch File Batch File to replace '.'...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Google Ads



Results for: Create batch file prompt

create batch file www.computing.net/answers/programming/create-batch-file/16262.html

Help creating batch file... www.computing.net/answers/programming/help-creating-batch-file/15530.html

Telnet using Batch file www.computing.net/answers/programming/telnet-using-batch-file/12716.html