Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: [SOLVE]how to copy it to txt  (Read 7360 times)

0 Members and 1 Guest are viewing this topic.

nwlun

  • Guest
[SOLVE]how to copy it to txt
« on: July 14, 2007, 08:06:58 AM »
..
« Last Edit: July 14, 2007, 08:28:48 PM by nwlun »

ghostdog74



    Specialist

    Thanked: 27
    Re: how to copy it to txt
    « Reply #1 on: July 14, 2007, 08:23:14 AM »
    dude..what are you trying to do?

    contrex

    • Guest
    Re: how to copy it to txt
    « 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









    nwlun

    • Guest
    Re: how to copy it to txt
    « Reply #3 on: July 14, 2007, 10:25:29 AM »
    so i cant copy the whole code to a txt???

    contrex

    • Guest
    Re: how to copy it to txt
    « 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 »

    nwlun

    • Guest
    Re: how to copy it to txt
    « 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

    ghostdog74



      Specialist

      Thanked: 27
      Re: how to copy it to txt
      « 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 )

      nwlun

      • Guest
      Re: how to copy it to txt
      « 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 ...

      ghostdog74



        Specialist

        Thanked: 27
        Re: how to copy it to txt
        « 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!

        nwlun

        • Guest
        [SOLVE]: how to copy it to txt
        « 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 »

        contrex

        • Guest
        Re: [SOLVE]how to copy it to txt
        « 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  :)

        nwlun

        • Guest
        Re: [SOLVE]how to copy it to txt
        « Reply #11 on: July 16, 2007, 08:02:34 AM »
         ???  :o