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. redis 操作 list 的测试

    lpush 从头部压入数据 127.0.0.1:6379> lpush listname value1 (integer) 1//返回list的当前长度 127.0.0.1:6379> l ...

  2. SharePoint Online 申请试用链接地址

    SharePoint Online 申请试用链接地址: https://products.office.com/en-us/business/compare-office-365-for-busine ...

  3. jQuery对数组操作

    //对象数组 var trackObj1={ , "direcLine":"line31" }; var currentTrack=[]; currentTra ...

  4. 2.4嵌套多重if else 的闰年判断以及bool变量的用法

    #include<stdio.h> #include<stdbool.h> int main() { int year; bool leap; //把leap定义为bool , ...

  5. Mac下安装ionic和cordova,并生成iOS项目

    为了开发HTML5,除了最新使用React Native等之外,目前首选的为稳定的ionic+Angularjs来开发iOS和android. Ionic(ionicframework一款接近原生的H ...

  6. js自动轮播图片的两种循环方法(原创)

    用5个div,布局从左到右5张图片,从左到右5个div分别指定ID为img1,img2,img3,img4,img5.(背景是relative,5个div是相对于背景absolute定位) 显示如下: ...

  7. 我们是怎么管理QQ群的

    文章背景:腾讯平台上的qq群数以千万百万计,但99%的在吹水扯蛋,从早上的问好开始,到晚上的晚安,无一不浪费青春之时间,看之痛心,无力改变,只好自己建了一个,希望能以此来改变群内交流的氛围或环境. 以 ...

  8. Java面试常见问题汇总

    1 String,StringBuffer与StringBuilder的区别??   String 字符串常量StringBuffer 字符串变量(线程安全)StringBuilder 字符串变量(非 ...

  9. opencart邮件模板

    在opencart中,几乎所有的版权信息都写在language里,我们找到catalog/language/your language/mail/order.php这个语言文件,找到 $_['text ...

  10. Appcan——Box

    Box架构 ub….. Box架构元素空间大小分配比例 ub-f……. Ub-f1,ub-f2,ub-f3……. Box架构元素垂直方向的位置排列 ub-ac,ub-ae… -webkit-box-a ...