Home / Microsoft / Microsoft DOS / [SOLVE]how to copy it to txt
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: [SOLVE]how to copy it to txt  (Read 2315 times)
nwlun
Guest
« on: July 14, 2007, 08:06:58 AM »

..
« Last Edit: July 14, 2007, 08:28:48 PM by nwlun » IP logged
ghostdog74
Mentor



Thanked: 26
Posts: 1,511


« Reply #1 on: July 14, 2007, 08:23:14 AM »

dude..what are you trying to do?
IP logged

contrex
Guest
« Reply #2 on: July 14, 2007, 09:28:35 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








IP logged
nwlun
Guest
« Reply #3 on: July 14, 2007, 10:25:29 AM »

so i cant copy the whole code to a txt???
IP logged
contrex
Guest
« Reply #4 on: July 14, 2007, 10:47:22 AM »

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.









« Last Edit: July 14, 2007, 12:31:24 PM by contrex » IP logged
nwlun
Guest
« Reply #5 on: July 14, 2007, 05:48:20 PM »

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 help
IP logged
ghostdog74
Mentor



Thanked: 26
Posts: 1,511


« Reply #6 on: July 14, 2007, 07:16:20 PM »

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 )
IP logged

nwlun
Guest
« Reply #7 on: July 14, 2007, 08:02:14 PM »

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 ...
IP logged
ghostdog74
Mentor



Thanked: 26
Posts: 1,511


« Reply #8 on: July 14, 2007, 08:07:31 PM »

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!
IP logged

nwlun
Guest
« Reply #9 on: July 14, 2007, 08:17:43 PM »

omg how come im so stupid ...solve myself
« Last Edit: July 14, 2007, 08:29:45 PM by nwlun » IP logged
contrex
Guest
« Reply #10 on: July 15, 2007, 04:23:19 AM »

nwlun, why did you delete your interesting batch code? It is still visible because I quoted it  :)
IP logged
nwlun
Guest
« Reply #11 on: July 16, 2007, 08:02:34 AM »

 ???  :o
IP logged
Pages: [1] - (Top) Print 
Home / Microsoft / Microsoft DOS / [SOLVE]how to copy it to txt « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.117 seconds with 20 queries.