为了保障原创作者在本站发表文章的利益, 并维护本站原创的精神, 特声明: RIAShanghai对有以下任何情况之一的文章将不通知作者并直接进行快意删除:
- 非原创, 或者原创但一文多发;
- 各种形式的广告与吹擂;
- 不符合本站文章格式.
欢迎各位读者监督. 谢谢合作. 另: 作为Adobe正式的UG, 我们将把Adobe不定期分发的软件,书籍及各种纪念品赠送给发文活跃的作者, 共同进步.
#!/bin/sh
LAUNCH_FOLDER=`dirname "$0"`;
cd $LAUNCH_FOLDER;
cd %~dp0
You can get a lot more information using different modifiers:
%~0 - expands %I removing any surrounding quotes (")
%~f0 - expands %I to a fully qualified path name
%~d0 - expands %I to a drive letter only
%~p0 - expands %I to a path only
%~n0 - expands %I to a file name only
%~x0 - expands %I to a file extension only
%~s0 - expanded path contains short names only
%~a0 - expands %I to file attributes of file
%~t0 - expands %I to date/time of file
%~z0 - expands %I to size of file
The modifiers can be combined to get compound results:
%~dp0 - expands %I to a drive letter and path only
%~nx0 - expands %I to a file name and extension only
%~fs0 - expands %I to a full path name with short names onlyRef: http://stackoverflow.com/questions/659647/how-to-get-folder-path-from-file-path-with-cmd