Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Batch file from C 1

Status
Not open for further replies.

kstargold

Programmer
Jun 7, 2004
27
US
I am writing a program to build a directory structure.

I have about 5000 files that are named class-user-number.doc

I want to build a directory structure off of this model.

/writ1300/smith/notes0.doc

I know enough to change the file names and create the directoy structure, however I would like to streamline the program so I don't have type:

dir /b >> listing.txt

(I have a batch file do this) then run the program.

How do I have the program run the batch file?

Thanks,
Kanan
 
Code:
system("dir /b >> listing.txt");
Is the simple one-line answer.

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top