Results 1 to 4 of 4

Thread: Distinguishing between files and directories

  1. #1
    Join Date
    Nov 2009
    Posts
    81

    Distinguishing between files and directories

    Hello. I have a some files and directories that is been placed in the folder. The thing is that I have a folder in which two different directories been placed in the same. I want to make a batch file or any program that would allow me to differentiate between the directories and folders that is been placed. I use Windows Xp as my operating system. Please help me. Thank you

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Distinguishing between files and directories

    Well as you use windows xp as the operating system there is an alternative or a way through which you could differentiate between them. You do not need to write any bath file or code any program for the same. Its just that the extension makes the things possible for differentiating. The .txt kind of file gives a better example. As you can have a check for such files by looking whether they have a . in the name.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Distinguishing between files and directories

    You could write a batch file or code the following in order to make the things necessary so that you can differentiate the directory and files. the following is the code:

    @echo OFF
    dir "C:\"
    if %errlvl% SQ 0 set errlvl=%errlvl%
    if errlvl 0 SET errlvl=0
    echo errlvl = %errlvl%

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Distinguishing between files and directories

    In batch files there is nothing like looping structures. You cannot add if and else loop in batch files mode. This has to be taken into consideration that the commands depends on the flow of the structure of data. The end loop will throw an error without an exception. By default the end file is been executed in command mode. cmd.exe. This might help you i differentiating the files and directories in the root folder that you are monitoring.

Similar Threads

  1. How to transfer multiple files or directories
    By Saura in forum Technology & Internet
    Replies: 5
    Last Post: 07-03-2010, 03:19 AM
  2. Replies: 4
    Last Post: 09-02-2010, 05:40 PM
  3. Show all files directories alphabetically with PHP
    By Zaafir in forum Software Development
    Replies: 4
    Last Post: 19-06-2009, 08:54 PM
  4. List all Files and Directories in a Directory
    By Samir_1 in forum Software Development
    Replies: 0
    Last Post: 08-12-2008, 07:32 PM
  5. How to Secure NTFS files and directories
    By T.J. in forum Tips & Tweaks
    Replies: 0
    Last Post: 11-11-2008, 02:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,700,290.62642 seconds with 17 queries