Announcement

Collapse
No announcement yet.

Looking for some help

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Looking for some help

    I am seeing of one of you gurus can create or have seen a batch type file that can take all the file names in a folder and create a text document output. I am trying to use this to keep track of all the files, by name only, in a specified folder. Now if there is one that also does by date, that is cool too! This does not have to be a batch file, but I simply just do not know what is out there that might do this.

    I really appreciate someone pointing me in the right direction!!
    "The chief foundations of all states, new as well as old or composite, are good laws and good arms; and as there cannot be good laws where the state is not well armed, it follows that where they are well armed they have good laws." -Machiavelli

  • #2
    Re: Looking for some help

    Originally posted by TheBigC View Post
    I am seeing of one of you gurus can create or have seen a batch type file that can take all the file names in a folder and create a text document output. I am trying to use this to keep track of all the files, by name only, in a specified folder. Now if there is one that also does by date, that is cool too! This does not have to be a batch file, but I simply just do not know what is out there that might do this.

    I really appreciate someone pointing me in the right direction!!
    I'm going to be lazy and point you in the direction of Cygwin, because it's been too long since I've had to do it with any flavour of DOS.
    First, Install Cygwin, a lightweight way of running Linux apps under Windows. Then...

    ls -a $DirPath | log.txt

    __________

    OK, I decided to remind myself how to do it in MS-DOS, so here's the result.

    @ECHO OFF
    :START
    DIR $DirPath >> log.txt
    IF errorlevel 1 GOTO MKFILE
    GOTO :END

    :MKFILE
    ECHO 1>log.txt
    GOTO START

    :END
    ECHO Quitting
    PAUSE

    The sorting you do with options tacked onto "Dir"

    For example: To sort by name, alphabetically, change the line starting with Dir to:
    DIR /o:n $DirPath >> log.txt
    To sort by date and time:
    DIR /o:d $DirPath >> log.txt

    To sort by name, suppressing the directory list and the heading and summary info:
    DIR /a:-d /b /o:n $DirPath >> log.txt

    Note that by default, the command will append your new listing to the end of the existing file. If you want to rewrite the contents every time, your best bet is to simply remove the file. Insert the following as the first command in the MKFILE loop
    DEL log.txt

    To run this as a scheduled job, I believe you have a nice GUI option built into WinXP now. No clue about Vista.

    I still recommend cygwin though :)




    Who needs a life when you can have a heavy bolter?
    --BlackMirror
    <23:03:38> "|TG|Smachin<BF Admin>" was kicked from the server by "|TG-70th| Zhohar" (UNDERAGE ban.)
    Anything over $600, and it would be pointless to try and reason with Grandma
    --Blackraven93

    Comment


    • #3
      Re: Looking for some help

      It does not have to be a DOS batch file, it is actually going to be on Windows Server. So if there is a Win App application that does this, by all means let me know!

      Thanks for the Cygwin
      "The chief foundations of all states, new as well as old or composite, are good laws and good arms; and as there cannot be good laws where the state is not well armed, it follows that where they are well armed they have good laws." -Machiavelli

      Comment


      • #4
        Re: Looking for some help

        Originally posted by TheBigC View Post
        It does not have to be a DOS batch file, it is actually going to be on Windows Server. So if there is a Win App application that does this, by all means let me know!

        Thanks for the Cygwin
        Karen's Directory Printer might do the trick.




        Who needs a life when you can have a heavy bolter?
        --BlackMirror
        <23:03:38> "|TG|Smachin<BF Admin>" was kicked from the server by "|TG-70th| Zhohar" (UNDERAGE ban.)
        Anything over $600, and it would be pointless to try and reason with Grandma
        --Blackraven93

        Comment

        Connect

        Collapse

        TeamSpeak 3 Server

        Collapse

        Advertisement

        Collapse

        Twitter Feed

        Collapse

        Working...
        X