Computing.Net > Forums > Windows XP > Batch Files In 'XP DOS'

Batch Files In 'XP DOS'

Reply to Message Icon

Original Message
Name: Flameboy_822
Date: March 5, 2004 at 09:00:44 Pacific
Subject: Batch Files In 'XP DOS'
OS: XP Pro
CPU/Ram: P4 3GHz 1Gb RAM
Comment:

Hi Guys
i'm trying to create some test files in dos in order to study network transfer times. They have to be byte specific. Can a batch file be created to copy a set amount of characters? because 1 character = 1 byte?
i need like 1000 bytes, 1371, all the way up to 13,500,021.
Any help would be much appreciated!
Cheers
Jon


Report Offensive Message For Removal


Response Number 1
Name: svg
Date: March 5, 2004 at 10:20:51 Pacific
Reply: (edit)

Hi Jon,

I suppose your question is:
You want to monitor the transfer-speeds from one comp to the next?

Just use the ping command.

BTW, I think 1 character = 2 bytes (Unicode)
___________________________________________
[Belgium, GMT+1]_________________________svg


Report Offensive Follow Up For Removal

Response Number 2
Name: wanderer
Date: March 5, 2004 at 10:23:09 Pacific
Reply: (edit)

Dont say Dos around here! I know you mean command line since dos doesn't exist in NT/W2K/XP.

You can copy files with a batch file no problem. Your byte count requirement could be solved by searching your drive for that sized file and then using it for your copy test.



Report Offensive Follow Up For Removal

Response Number 3
Name: wizard-fred
Date: March 6, 2004 at 01:55:04 Pacific
Reply: (edit)

Followed from your original post in DOS.

In order to test copy speeds you do need to have files of various sizes. Copying of files is not only the transfer of x bytes, there is overhead in opening the file, reading the file om the sending end. On the receiving end, creating file name, writing data, and closing file. If the files are small the may take an appreciable part of the total transfer time. Add the variables of CPU speed, Hard drive speed, Network speed, packet size and drive fragmentation.

I once did a some what similar test in that I wanted to find how long it would take to write a CD with small files on the worse case directory structure. I wrote a program to create files 8 subdirectories deep. The program took 20-30 minutes to create 200 megs of data files. Result, not possible to directly burn the data because of data underrun.

For your problem you will have to set your benchmark baseline. I think you have to copy enough data to saturate the pipeline. I think may be on the order of 50 to 100 MB per batch. Files should be created in a subdirectories to equal the transfer amount.
File Names should be the same length.

To create the files I would use any programming language that you are comfortable in. I used BASIC to create random files with pseudo random data. Ex: For a 1 MB File, Write 10000 records 100 bytes long. For 50 MB transfer make 50 files

To digress: I just thought of something, If you are copying to a mapped drive, then instead have the program create the files on the other computer. This would give the transfer time plus creation time. Run the program on the other computer, That would give creation time direct writing. The difference would be the transfer time. The program could internally clock the transfer time. Just change the parameters and rerun for the different file sizes. Or have I made an incorrect assumption. Scratch the idea, it will only work if there is only 1 write per file size, for files up to max size of variable 32k-64k.

Back to the batch copy.

For timing, The old Norton Utilities (DOS) had a command TIME START | STOP which would act as a stop watch. Probably the are present equivalents that would work.

Good Luck, Interesting


Report Offensive Follow Up For Removal

Response Number 4
Name: DCM123
Date: March 27, 2004 at 12:42:27 Pacific
Reply: (edit)

Is It Possible to read a specific character from a string in a batch file. For example if the String TEST contained "123456" would it be possible to determine what the second character is i.e "2". Thanks in advance.


Report Offensive Follow Up For Removal

Response Number 5
Name: wizard-fred
Date: March 27, 2004 at 18:59:56 Pacific
Reply: (edit)

I think you should have started a new post. It is 21 day since the last response.

Anyway to answer the question

Yes


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Batch Files In 'XP DOS'

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes Today.
Discuss in The Lounge