Computing.Net > Forums > Programming > Pass text file to DOS command

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.

Pass text file to DOS command

Reply to Message Icon

Name: rahulgupta
Date: December 18, 2008 at 05:31:15 Pacific
OS: Windows XP
CPU/Ram: Core 2 duo
Product: Don't know / DON'T KNOW
Comment:

Hi,

I have a text file having names of some folders which are dynamically gengerated in it. Now i want to pass these folder names one by one to a command written by me. How can go about it?



Sponsored Link
Ads by Google

Response Number 1
Name: Judago
Date: December 18, 2008 at 15:38:25 Pacific
Reply:

[some of this post is reycled]

As far as I'm aware DOS can't read files without third party tools.

Do you mean scripting with windows batch script, for systems derived from windows nt? If your particular version of windows is on this list it should be possible to read plain text files using batch.

If your are using a NT based system this may do it:


for /f "usebackq delims=" %%a in ("file") do (
You command eg xcopy "%%a" "c:\newdir" /e /i
)

%%a will be one line of the text file at a time.


0

Response Number 2
Name: rahulgupta
Date: December 18, 2008 at 21:46:37 Pacific
Reply:

Thnx Judago,

Your code worked absolutely fine in my script. Thnx a lot.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







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


Sponsored links

Ads by Google


Results for: Pass text file to DOS command

batch to delete text file header www.computing.net/answers/programming/batch-to-delete-text-file-header/15107.html

Importing Text file to Ms Access www.computing.net/answers/programming/importing-text-file-to-ms-access/4308.html

Pass id & pw variables from bat to text file www.computing.net/answers/programming/pass-id-pw-variables-from-bat-to-text-file/19299.html