There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Software Development
Tag Cloud
audio blue screen boot bsod computer cpu crash dell desktop driver drivers error excel external hard drive firefox freezes freezing hard drive hardware hijackthis internet internet explorer itunes laptop mac malware motherboard mouse network networking outlook 2007 power printer problem ram router screen slow sound trojan usb virus vista vista 32-bit windows windows vista windows xp winxp wireless wmp
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
batch files


Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
racer6571's Avatar
Junior Member with 2 posts.
 
Join Date: Feb 2004
06-Feb-2004, 06:21 PM #1
batch files
I am in a beginner A+ hardware class and we have to write a batch file that will capture all directories and files on a hard drive, put the info in a flat file and then import the info to a graph listing # of files on one side and # of allocation units on the other.

I have had basically no batch file experience and am totally lost. Can anyone help?
cybertech's Avatar
Computer Specs
Moderator with 61,499 posts.
 
Join Date: Apr 2002
Location: Washington State
06-Feb-2004, 06:32 PM #2
dir c:\*.* /s > c:\test.txt

That should get you started

Now you figure out the rest, ok!

Good luck!

Good DOS site
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
06-Feb-2004, 07:24 PM #3
The /b switch added to the dir command will give you a list of directories and files without the header information -- like this

c:\windows
c:\config.sys
c:\autoexec.bat

It also leaves out the file size and date information -- you may need that to get the number of allocation units but I don't know.
racer6571's Avatar
Junior Member with 2 posts.
 
Join Date: Feb 2004
08-Feb-2004, 12:19 PM #4
Thanks for the help. I am still lost as to how to extract only the number of files and directories and import it to a graph (in Excel or Powerpoint).
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
09-Feb-2004, 06:07 AM #5
I would think you would need to create a csv file.

filename,size

and then import it into excel.

the dir command doesn't allow you to just output the filename and size together. (AFAIK)

So there must be a better way to do it.

now ls command that comes with cygwin and mysys (mingw.org) , allows you to list just the filename and size.

The command would be ls -s -1 > graph.csv

And then you could import it and use a formula to add the range of file sizes to get the total. You would still be using a batch file to execute the command.

Just for kicks, if you want a program to output a filelist you can use

http://home.a03.itscom.net/tsuzu/programing/en/ls.zip

only select filename, size, set unit to none, include hidden, and set to csv file.

You should also ask your question at www.hardforum.com in the webmastering and programming forum.
__________________
10 ? "a line as the unending horizon"
20 ? "a curve as the rolling hillside"
30 ? "a point as a distant bird"
40 ? "a ray as the rising sun"
run
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
10-Feb-2004, 08:11 AM #6
The discussion continues here .
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 08:16 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.