Add Comment
|
Related Links
|
TrackBack
dirname.bat (GPL)This "dirname.bat" is a Windows batch program that performs the same function as as the UNIX "dirname" command. And that function is to strip the child name from the parent path. You can call this script from your own custom batch script to extract the parent path. "dirname.bat" takes advantage of the SetNumberOfArguments.bat (GPL) script that is available on this web site. So to use "dirname.bat", you'll have to download SetNumberOfArguments.bat, if you don't already have it. "dirname.bat" is distributed as executable source code under the GNU General Public License. Please see the license agreement elsewhere on this site. Usagedirname.bat "path" Examples> dirname "\Users\Medusa\Documents\My Games\Dawn of War 2" Chieh Cheng I found a bug in "dirname.bat" where it would not correctly handle a remote Windows directory (a path that starts with two '\' characters). I fixed the problem in the version attached below. Chieh Cheng I found another bug, where you only specify the name but no directory. I've fixed the code so that it outputs a '.' in such a case, which matches UNIX implementation. The fixed version is attached below. Chieh Cheng The previous version of "dirname.bat" fails when the path contains parentheses. The version attached below fixes that problem. Chieh Cheng Found that the last fix introduced a bug that occurs when you do not specify a parent path or if the parent path is root. I've attached the fixed version below. The following are examples of correct output. Examples> dirname.bat \bin Chieh Cheng
Add Comment
|
Related Links
|
TrackBack
Did your message disappear? Read the Forums FAQ. Add CommentSpam Control | * indicates required field TrackBackTrackBack 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
76 Users Online
|
Copyright © 1996 - 2024. All Rights Reserved. |