- DirectoryUtility = {
- // function getCurrentDirectory: returns currentDirectory path
- // with a trailing backslash.
- getCurrentDirectory : function ( ) {
- var scriptFullName = WScript.ScriptFullName;
- var scriptName = WScript.ScriptName;
- return scriptFullName.substr ( 0, scriptFullName.lastIndexOf ( scriptName ) );
- }
- }
- /* 用法 */
- DirectoryUtility.getCurrentDirectory ( );
- //该片段来自于http://www.codesnippet.cn/detail/070120131382.html
来源: http://www.codesnippet.cn/detail/070120131382.html