1.

Solve : [SOLVE]how to copy it to txt?

Answer»

..dude..what are you trying to do?Quote from: ghostdog74 on July 14, 2007, 08:23:14 AM

dude..what are you trying to do?

If you couldn't tell by looking at it, you could have copied it and run it, then you'd know.

First a variable %dirlist% is created and left blank

Then in the first LOOP:-

- is extracted from the output of fsutil, for each drive on the system, the drive letter, a colon and a backslash eg C:\

- neatly USING CALL SET, each such 3 char string is appended with a leading space to the string variable %dirlist% eg C:\ D:\ E:\

The second loop:-

- iterates through this string variable %dirlist% and for each drive calls fsutil to get drivetype eg

C:\ - Fixed Drive
D:\ - Fixed Drive
E:\ - CD-ROM Drive

nwlun, if you want to get this output into a text file, just redirect the output to a text file, and you can use TYPE to see it on the screen if desired.

Quote
@echo off

if exist dt.txt del dt.txt

set drlist=

for /f "tokens=*" %%a in ('fsutil fsinfo drives^|find /v ""') do (

set dr=%%a

call set drlist=%%drlist%% %%dr:~-3%%
)

for %%a in (%drlist%) do fsutil fsinfo drivetype %%a >> dt.txt

type dt.txt







so i cant copy the whole code to a txt???I don't understand what your problem is.

If you got the code of the batch file into a post on a web page, surely you can get it into a text file?

Do you know how to highlight, copy, and paste text? Have you used Notepad before?

Anyway, if you have run the code, then you must have it in a batch file. A batch file is a text file. What is the problem?

Please say what you want to do, more clearly.









this code is just a portion of my batch file but i only want this whole code to copy to a txt

that why i ask helpQuote from: contrex on July 14, 2007, 10:47:22 AM
I don't understand what your problem is.
see what i mean? If he has written the batch, its already being saved as a batch file(text file). So why does he need to save that batch file again after running it? it makes no sense. he MIGHT as well use copy to copy the batch file to another. that's why i had asked him what he's trying to do. ( Unless of course, if what he's referring to is just output redirection, then that should be it )
Quote from: ghostdog74 on July 14, 2007, 07:16:20 PM
Quote from: contrex on July 14, 2007, 10:47:22 AM
I don't understand what your problem is.
see what i mean? If he has written the batch, its already being saved as a batch file(text file). So why does he need to save that batch file again after running it? it makes no sense. he might as well use copy to copy the batch file to another. that's why i had asked him what he's trying to do. ( Unless of course, if what he's referring to is just output redirection, then that should be it )



u guys will understand if u have 2 pc there is nth to argue also...like i said this is just a portion of my batch ...Quote from: nwlun on July 14, 2007, 08:02:14 PM
Quote from: ghostdog74 on July 14, 2007, 07:16:20 PM
Quote from: contrex on July 14, 2007, 10:47:22 AM
I don't understand what your problem is.
see what i mean? If he has written the batch, its already being saved as a batch file(text file). So why does he need to save that batch file again after running it? it makes no sense. he might as well use copy to copy the batch file to another. that's why i had asked him what he's trying to do. ( Unless of course, if what he's referring to is just output redirection, then that should be it )



u guys will understand if u have 2 pc there is nth to argue also...like i said this is just a portion of my batch ...
so you want to copy the batch to another PC? man, you should have described your problems more clearly! omg how come im so stupid ...solve myselfnwlun, why did you delete your interesting batch code? It is still visible because I quoted it


Discussion

No Comment Found