System.Diagnostics.Process.Start("Explorer.exe", string.Format("/e, \"{0}\" ", TargetFileName));

Windows Explorer can be invoked (called, started) with parameters to get a specific view.

Syntax

explorer [/n] [/e,] [/root,object,][[/select],sub-object,]

Strangely enough a final comma is required (at least in some cases – not known in which ones)!

Parameters

/n Opens a window in single-paned (My-computer) view for each selected item, even if the new window duplicated a window that is already open. This is the default view.
/e Uses Windows Explorer view, which is most similar to File Manager view (Windows 3.x).
/root,object Specifies the root level of the specified view. Default is to use the normal namespace root (desktop = my computer), whatever is specified for the root for the display.
/select If /select is used, the parent folder is opened and the specified object is selected.

Examples

Display (explorer mode) drive D only Explorer.exe /e, /root, d:\
Display (explorer mode) the start menu programs Explorer.exe /e, /root, "f:\Win_95\Start Menu\Programs"
Diplay (single paned view) the c:windows folder and select calc.exe Explorer.exe /select,c:\windows\calc.exe
Display single pane view with drive m selected Explorer.exe /e, /select, "m:\"

Explorer [/n] [/e] [(,)/root,<object>] [/select,<object>]

/n                Opens a new single-pane window for the default
selection. This is usually the root of the drive Windows
is installed on. If the window is already open, a
duplicate opens. /e Opens Windows Explorer in its default view. /root,<object> Opens a window view of the specified object. /select,<object> Opens a window view with the specified folder, file or
application selected. Examples: Example 1: Explorer /select,C:\TestDir\TestApp.exe Opens a window view with TestApp selected. Example 2: Explorer /e,/root,C:\TestDir\TestApp.exe This opens Explorer with C: expanded and TestApp selected. Example 3: Explorer /root,\\TestSvr\TestShare Opens a window view of the specified share. Example 4: Explorer /root,\\TestSvr\TestShare,select,TestApp.exe Opens a window view of the specified share with TestApp selected.

windows 用默认软件打开文档的更多相关文章

  1. AHK(1)之运行程序或打开文档

    小鸟学AHK(1)之运行程序或打开文档   AHK就是AutoHotKey,是一款免费的.Windows平台下开放源代码的热键脚本语言. 亲爱的朋友,叫我怎么向你推荐它呢! COOL,对,就是酷,那么 ...

  2. PowerPoint 打开文档发现.pptx中胡内容有问题

    一.问题的提出 有一个文件,在window 7操作系统中通过邮箱地址保存到本地,结果打开的时候出现[PowerPoint 打开文档发现 文件.pptx中胡内容有问题] 然后提示[如果您信任此演示文稿的 ...

  3. 修改Windows7系统默认软件安装目录

    Windows7系统默认软件安装目录都在C盘Program Files文件夹有时候我们需要把软件安装到其他地方,如果每次安装的时候都要重新选择一次十分麻烦,下面Windows7之家教你修改软件默认安装 ...

  4. 软件开发过程文档-cgaowei

    鸡肋——食之无味,弃之可惜”,软件开发过程文档遭遇了鸡肋一样的境遇. 目前敏捷软件开发过程非常流行.相对于软件开发过程文档,敏捷软件开发过程更加重视可运行的程序.关于软件开发过程文档,两个极端都是不可 ...

  5. iOS SDK:预览和打开文档

    iOS中的沙盒可以让平台更加的安全,这也是沙盒给用户带来的最主要好处.不过由于沙盒的严格限制,导致程序之间共享数据比较麻烦.一般在程序间共享文档可以通过UIDocumentInteractionCon ...

  6. Windows Redis默认配置文件,Redis配置不生效解决方案

    Windows Redis默认配置文件,Redis配置不生效解决方案, Windows Redis自启动配置不生效解决方案,Windows Redis增加自动启动服务 >>>> ...

  7. 将Windows系统默认的Administrator帐号改名为我们自定义的名称

    将Windows系统默认的Administrator帐号改名为我们自定义的名称.. ---------如何将Administrator帐号改名为我们自定义的名称:Win+R--->>输入g ...

  8. 如何将Windows电脑桌面上软件图标下的文字去掉

    如何将Windows电脑桌面上软件图标下的文字去掉 重命名的时候,点击鼠标右键.选择“插入Unicode控制字符” 效果

  9. Linux之Ubuntu与Windows更改默认启动顺序[转载]

    装双系统后,经常会遇到与Windows更改默认启动顺序的需要,这样有助于开机时可以避免手动选择经常使用的系统了. 当然这解决办法不是博主的主意,本文纯属抄録者,故文章题目也声明了是转载,解决方案如下叙 ...

随机推荐

  1. PHP中explode和implode的区别

    字符串的连接与分割是非常重要的两个内容,通过其可以将数组按照指定的规则转换成字符串,也可以将字符串按照指定的规则进行分割,返回一个数组.其应用范围很广,如在购物网站的购物车,在线投票系统等.这两项技术 ...

  2. selenium 定位元素

    一.单个元素的定位方式: By.className(className))By.cssSelector(selector)By.id(id)By.linkText(linkText)By.name(n ...

  3. TomCat的安装与配置方法

    经过自己的研究,各种烦,所以要写个博客,帮助大家安装这个软件. 一.安装TomCat(因为大家都安装了jdk,所以就不写了) 1.下载TomCat 网址如下:http://tomcat.apache. ...

  4. java在线支付

    http://blog.csdn.net/lidew521/article/category/1437251

  5. [git] warning: LF will be replaced by CRLF | fatal: CRLF would be replaced by LF

    遇到这两个错误,是因为Git的换行符检查功能. core.safecrlf Git提供了一个换行符检查功能(core.safecrlf),可以在提交时检查文件是否混用了不同风格的换行符.这个功能的选项 ...

  6. 哪些问题是面试官经常问Java工程师的问题 ? --- 转自quora

    Which are the frequently asked interview questions for Java Engineers ? Vivek Vermani, www.buggybrea ...

  7. 关于java中自增,自减,和拓展运算符的小讨论

    java中运算符很多,但是能深入讨论的不算太多.这里我仅仅以++,*=为例做讨论. 例:++ i=0; i=i++ + ++i;//i=1 i=++i+i++;//i=2 i=i++ -++i;//i ...

  8. 解决eclipse编辑js和html卡的问题

    window -> Preference -> General -> Editors -> Text Editors -> HyperLinking ->  取消勾 ...

  9. 安装和卸载windows服务 bat

    1. 安装 windows服务 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\installutil    [服务路径](例:C:\\test\myt ...

  10. shanquan2的两年三题系列

    好像只有2个月就退役啦 不管了,先说一下哪三题:多点求值.lcm.替罪羊树(bzoj3065) [upd0]2016.3.29 多点求值A掉啦,myy卡常数sxbk(不是说好的是shanquan2出的 ...