Computing.Net > Forums > Disk Operating System > DOS Scripting

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

DOS Scripting

Reply to Message Icon

Name: bfensty74
Date: March 9, 2004 at 07:53:15 Pacific
OS: DOS
CPU/Ram: NA
Comment:

Is there a way for the get command to prompt for the user to input the file?



Sponsored Link
Ads by Google

Response Number 1
Name: jboy
Date: March 9, 2004 at 08:06:02 Pacific
Reply:

Possibly you could be a bit more specific?

Take a look at the options for DOS CHOICE.

What version of DOS?


If at first you don't succeed, try, try again. Then give up. There's no sense being a damn fool about it.


0

Response Number 2
Name: bfensty74
Date: March 9, 2004 at 08:12:06 Pacific
Reply:

we are using 6.22


0

Response Number 3
Name: jboy
Date: March 9, 2004 at 08:27:59 Pacific
Reply:

Well, you could've put that in your message under 'OS'.

Still pretty vague on what exactly you're trying to do.


If at first you don't succeed, try, try again. Then give up. There's no sense being a damn fool about it.


0

Response Number 4
Name: bfensty74
Date: March 9, 2004 at 08:34:01 Pacific
Reply:

Sorry about the vague.....

We are trying to have dos machines ftp a file to the PC however the file always changes so I want the user to input the filename. So basically I was wondering if there is a way to prompt the get command?

I made a .bat file to run along with a .txt file for the answers.

ex.


this is the .bat

ftp -s:c:\ftp.txt

this is the .txt

open x.x.x.x
myusername
mypassword
binary
ls

I basically am very rusty with DOS.

So need some help


0

Response Number 5
Name: jboy
Date: March 9, 2004 at 08:57:10 Pacific
Reply:

Ok, that's clearer : )

I'm not too familiar with the ftp command, but I suspect that there's a better way of batching it.

By referencing ftp.txt - that's fairly specific and won't, I don't think, allow for any flexibility.

A lot depends on the potential user - you would need to include an error handling routine in case of incorrect entries.

You could use 'replaceable parameters:

ftp -s:%1

- where %1 represents the name of the script file to be used - this presumes that the user will know which text file to input (and it's location).

This seems less than ideal - better would be prompting for user input for each variable, but I'm afraid I don't know how that would work using 'ftp'


If at first you don't succeed, try, try again. Then give up. There's no sense being a damn fool about it.


0

Related Posts

See More



Response Number 6
Name: bfensty74
Date: March 9, 2004 at 08:59:04 Pacific
Reply:

Could you give an example from what I gave you.


0

Response Number 7
Name: jboy
Date: March 9, 2004 at 09:12:49 Pacific
Reply:

Syntax

ftp [ -d ] [ -g ] [ -i ] [ -n ] [ -v ] [ HostName [ Port ] ]

Well, a lot depends on the user - I mean, you could have a series of script files and assume that the user knows which one is appropriate.

If you wanted to write error handling routines, you'd likely use if errorlevel and goto statements in the batchfile and/or the CHOICE command.

It can get more than a little complicated.


If at first you don't succeed, try, try again. Then give up. There's no sense being a damn fool about it.


0

Response Number 8
Name: bfensty74
Date: March 9, 2004 at 10:22:50 Pacific
Reply:

It basically has to be as basic as possible the users really wouldn't know commands..I really just want them to enter the job number and download the file.


0

Response Number 9
Name: jboy
Date: March 9, 2004 at 11:29:35 Pacific
Reply:

Well, that's what I'd thought. Could prove to be problematic if you're as rusty at DOS batching as you say. Might have to do a bit of research:

FTP Batch

Example

... maybe you can find a 'readymade' file that you could use or modify.

Check back, someone more familiar with ftp than I am may be able to provide an answer for you.


If at first you don't succeed, try, try again. Then give up. There's no sense being a damn fool about it.


0

Response Number 10
Name: jboy
Date: March 9, 2004 at 11:54:28 Pacific
Reply:

Also, Secret_Doom's (aka Leonardo Pignataro) website may be of interest.

Haven't seen him around these parts lately, but he was the resident batchfile guru.


If at first you don't succeed, try, try again. Then give up. There's no sense being a damn fool about it.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: DOS Scripting

DOS script to format data? www.computing.net/answers/dos/dos-script-to-format-data/14358.html

DOS script for FTP upload www.computing.net/answers/dos/dos-script-for-ftp-upload/14559.html

Disk space check- Dos script www.computing.net/answers/dos/disk-space-check-dos-script/15339.html