Cynosure.X International LLC

:

Add Comment | Related Links | TrackBack
Related Content

IsDirectory.bat (GPL)

IsDirectory.bat is a Windows batch program that can help determine if a specified path is a directory or not. IsDirectory.bat outputs 1 (for true) when the command-line argument is a directory. Otherwise, it outputs 0 (for false).

IsDirectory.bat takes advantage of the SetNumberOfArguments.bat (GPL) script that is available on this web site. So to use IsDirectory.bat, you'll have to download SetNumberOfArguments.bat, if you don't already have it.

IsDirectory.bat is distributed as executable source code under the GNU General Public License. Please see the license agreement elsewhere on this site.

Usage

IsDirectory.bat "path"

Attached File: IsDirectory.bat (558 B)

Chieh Cheng
Wed, 01 Oct 2008 09:26:31 +0000

I found a bug with "IsDirectory.bat" where it couldn't recognize "..\" as a directory. And it couldn't recognize drives (e.g. "e:\") as directories.

I've fixed the problem and the new version is attached below.

Attached File: 1 - IsDirectory.bat (604 B)

Chieh Cheng
Mon, 01 Mar 2010 08:36:14 +0000

dir /a:d %1
echo %ERRORLEVEL%

crampies
Fri, 03 Sep 2010 16:33:51 +0000

There are some exception cases that the previous version cannot handle. Therefore, I have made the "IsDirectory.bat" script a little more robust. The new version is attached below.

Attached File: 2 - IsDirectory.bat (925 B)

Chieh Cheng
Sun, 16 Feb 2014 11:24:12 +0300

Found that the previous versions of "IsDirectory.bat" could not handle '&' character in directory and file name. Using crampies' tip above, I have updated the script to handle '&' correctly. The new version is attached below.

Attached File: 3 - IsDirectory.bat (744 B)

Chieh Cheng
Mon, 17 Feb 2014 11:26:18 +0300

Discovered that this script fails on directory where we don't have permission to access. Updated it in the version below to now work with no permission directories.

Attached File: 4 - IsDirectory.bat (2 KB)

Chieh Cheng
Sat, 01 Feb 2020 21:40:03 -0800

Add Comment | Related Links | TrackBack
Related Content

Did your message disappear? Read the Forums FAQ.

Add Comment

Spam Control | * indicates required field
Your Name: *
E-mail:
Remember Me!
Comment: *
File attachment is optional. Please do not attach a file to your submission unless it is relevent.
Attach File:
(20 MB Max)
Spam Protection: * Answer of 3 + 0?
Click button only once, please!

TrackBack

TrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.

Send Ping | TrackBack URL | Spam Control

No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here.

Messages, files, and images copyright by respective owners.

Products | Services
Forums | Latest | RSS
Library | Search | Wiki
Help | Licenses

Login | Register

71 Users Online

Hacking Digital Cameras
Fun for Photographers



Amazon Associate

Copyright © 1996 - 2024. All Rights Reserved.