Solved

Dump to text file in winbatch

Posted on 2004-09-09
4
722 Views
Last Modified: 2013-12-03
I am looking for a way to print the contents of a directory to a text
file using winbatch.

 Here is what I have currently.

DirChange("\\mxbiis01\c$\ftp\LocalUser\dkftp")
Handle=FileOpen("C:\list.txt","WRITE")
FileWrite(handle,"FileItemPath")
FileItemPath("*.*")   ; get file list
FileClose(handle)

I know the problem is with the filewrite command.

Any suggestions
0
Comment
Question by:healthcheckinc
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
void_main earned 250 total points
ID: 12130703
Hi healthcheckinc!

I suggest this way:

instead of
-------------------8<---------------------------------------
DirChange("\\mxbiis01\c$\ftp\LocalUser\dkftp")
Handle=FileOpen("C:\list.txt","WRITE")
FileWrite(handle,"FileItemPath")
FileItemPath("*.*")   ; get file list
FileClose(handle)
-------------------8<---------------------------------------


write this code
-------------------8<---------------------------------------
ShellExecute("dir", ">c:\list.txt", "\\mxbiis01\c$\ftp\LocalUser\dkftp", @NORMAL, "")
-------------------8<---------------------------------------

this invokes a system call and forces the "dir" command to write the output to the textfile.
The disadvantage is, the dir command writes additional information to that file.

regards
void_main
0
 
LVL 4

Expert Comment

by:void_main
ID: 12407819
Good suggest @venabili
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question