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

Create batch file prompt

Reply to Message Icon

Original Message
Name: remgu
Date: May 3, 2007 at 07:53:30 Pacific
Subject: Create batch file prompt
OS: Windows XP SP2
CPU/Ram: P4 3.4Ghz 1GB Ram
Model/Manufacturer: 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


Report Offensive Message For Removal


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

@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.



Report Offensive Follow Up For Removal

Response Number 2
Name: remgu
Date: May 3, 2007 at 10:21:40 Pacific
Reply: (edit)

WOW! Thanks IVO!

Thanks,
REMGU


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Create batch file prompt

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge