Solved

Dump to text file in winbatch

Posted on 2004-09-09
4
743 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

617 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