Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...It's extraordinarily refreshing to see truly expert advice without having to wade through hipper than thou attitude..."

Geography

Where in the world do Tek-Tips members come from?
DougP (MIS)
28 Jun 12 11:21
I want ot quickly see the files and the number of files in a folder.
I have this code which works great for puting the names of files in notepad txt file
then I have code whihc counts files but it only counts them whereever the bat file is setting I want to mody this to count file in the folder I specify and also maybe put that number at the bottom of the text file.

CODE

dir "C:\Users\z533560\Documents\Time Reporting Validation\06_23_12 Newtech Timesheets\Voz" /b /on > "C:\Users\z533560\Desktop\TimesheetsFiles.txt"

notepad TimesheetsFiles.txt

set c=0
:TOP
for /f "tokens=1*" %%a in ('dir "C:\Users\z533560\Documents\Time Reporting Validation\06_23_12 Newtech Timesheets\Voz" /a * /b /s') do (
       call set /a c=%%c%%+1
)
ECHO %c% Files.
REM save the %c%  number to the bottom of the text file? 

TIA

DougP

DSummZZZ (Programmer)
28 Jun 12 12:24
You could try substituting:
DIR %1

in the first line instead of using:
dir "C:\Users\z533560\Documents\Time Reporting Validation\06_23_12 Newtech Timesheets\Voz" /b /on > "C:\Users\z533560\Desktop\TimesheetsFiles.txt"

To add the counts to the end of the file, try this:

ECHO %c% Files >> TimesheetsFiles.txt
">>" says to append to the end of the file.

-Dave Summers-
cheers
Even more Fox stuff at:
http://www.davesummers.net/foxprolinks.htm

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close