Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , ,

Sponsored Links



Distinguishing between files and directories

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 05-12-2009
Member
 
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
Reply With Quote
  #2  
Old 05-12-2009
Praetor's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,937
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.
Reply With Quote
  #3  
Old 05-12-2009
Member
 
Join Date: May 2008
Posts: 1,990
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%
Reply With Quote
  #4  
Old 05-12-2009
kelfro's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,976
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Distinguishing between files and directories"
Thread Thread Starter Forum Replies Last Post
How to transfer multiple files or directories Saura Technology & Internet 5 07-03-2010 03:19 AM
How to run dos2unix recursively on all files except under .svn/ directories Juaquine Software Development 4 09-02-2010 05:40 PM
Show all files directories alphabetically with PHP Zaafir Software Development 4 19-06-2009 09:54 PM
List all Files and Directories in a Directory Samir_1 Software Development 0 08-12-2008 07:32 PM
How to Secure NTFS files and directories T.J. Tips & Tweaks 0 11-11-2008 02:26 PM


All times are GMT +5.5. The time now is 03:38 AM.