学习记录——【转】java中打开explorer
2010-05-29 18:00
567 查看
很我找了好久 终于找到了.....
以下是转文:
//--------------------------------------------------------------------------------------------------
方法很简单,调用explorer.exe就可以,
Runtime.getRuntime().exec(
"rundll32 SHELL32.DLL,ShellExec_RunDLL " +
"Explorer.exe /select," + targetDirectFileName);
//以下内容不需要....
[Windows Explorer Switches]
Windows Explorer switches are useful in creating rooted folders:
Explorer [/e][,/root,<object>][[,/select],<sub object>]
/e
Use Explorer view (scope and results pane view). The default is
Open view (results in pane view only).
/root<object>
Specify the object in the "normal" name space that is
used as the root (top level) of this Explorer/Folder (i.e., local
path or UNC name). The default is the Desktop).
/Select
The parent folder opens and the specified object is selected.
<sub object> Specify the folder unless /select is used. The
default is the root.
本文来自CSDN博客:http://blog.csdn.net/denlee/archive/2007/04/23/1575961.aspx
//--------------------------------------------------------------------------------------------------
以上是原文 下面是个人尝试
举个例子:
这样就打开C盘了 ,经试验 那几个dll文件也可以不添加 直接写:
Runtime.getRuntime().exec( "Explorer.exe /select," + "c:/");也行
以下是转文:
//--------------------------------------------------------------------------------------------------
方法很简单,调用explorer.exe就可以,
Runtime.getRuntime().exec(
"rundll32 SHELL32.DLL,ShellExec_RunDLL " +
"Explorer.exe /select," + targetDirectFileName);
//以下内容不需要....
[Windows Explorer Switches]
Windows Explorer switches are useful in creating rooted folders:
Explorer [/e][,/root,<object>][[,/select],<sub object>]
/e
Use Explorer view (scope and results pane view). The default is
Open view (results in pane view only).
/root<object>
Specify the object in the "normal" name space that is
used as the root (top level) of this Explorer/Folder (i.e., local
path or UNC name). The default is the Desktop).
/Select
The parent folder opens and the specified object is selected.
<sub object> Specify the folder unless /select is used. The
default is the root.
本文来自CSDN博客:http://blog.csdn.net/denlee/archive/2007/04/23/1575961.aspx
//--------------------------------------------------------------------------------------------------
以上是原文 下面是个人尝试
举个例子:
Runtime.getRuntime().exec( "rundll32 SHELL32.DLL,ShellExec_RunDLL " + "Explorer.exe /select," + “c:/”);
这样就打开C盘了 ,经试验 那几个dll文件也可以不添加 直接写:
Runtime.getRuntime().exec( "Explorer.exe /select," + "c:/");也行
相关文章推荐
- 【java学习记录】10.实现基本的记事本功能(新建、打开、另存为)和简单的加解密功能
- Java入门学习记录1
- java学习记录--ThreadLocal使用案例
- 对于Java学习的一些看法,记录心得也是学习的一种方式
- Java视频学习截图记录
- java core学习,记录看到的需要注意的
- Java8学习记录(一)-函数式接口
- 【声明】本博客全部内容均为本人java学习记录,并不权威,欢迎共勉一起努力。
- Java基础学习记录笔记(运行环境+程序编写)
- java的学习记录6
- Java学习记录
- Java中的一些常用的杂项学习记录
- Java与C#的比较学习记录(3)
- JAVA学习记录(四)面向对象编程三大特性之封装
- 黑马程序员Java培训、Android培训-Java 学习过程记录_面向对象上2
- java后台学习历程记录
- 黑马程序员Java培训、Android培训-Java 学习过程记录_面向对象下
- JAVA学习记录---入门---for,each循环
- java 7 并发 初级 学习记录(2)
- 从今天开始我要开始写学习java的日常记录了。