使用& amp;#39; Open With& amp; amp; amp; amp; amp; amp; amp; amp; amp; amp;#39;打开应用程序时,如何确定当前目录? [英] How is the Current Directory determined when opening an app with 'Open With'?

查看:112
本文介绍了使用& amp;#39; Open With& amp; amp; amp; amp; amp; amp; amp; amp; amp; amp;#39;打开应用程序时,如何确定当前目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Windows应用程序并遇到文件关联问题。


在Windows 7及更低版本中,我注意到当我右键单击文件时,选择"打开方式"并选择我的(或任何)应用程序,启动的进程的当前目录与我单击的文件所在的目录相同。这是所需的
行为。


但在Windows 10上,我看到当前目录设置为System32,由于应用程序尝试写入Current,因此该功能并不是很好目录并获取权限问题。


我的第一个问题是 - 是否有任何文档在每种情况下使用当前目录。


第二个问题是 - 是否有一些方法可以在注册表中为某些文件类型或exes定义默认的当前目录。我可以在Windows 10中将openwith的行为更改为与以前版本中相同吗?


谢谢!

解决方案

您好,


您已将当前目录设置设置为System32,因为当您选择"打开方式"时,正在使用  openwith.exe,它位于System32,您需要启用"始终将此应用程序用于*(文件)",然后使用双
点击再次打开它。然后当前目录将更改为您想要的。



最好的问候,



德雷克


I'm working on a windows application and having some issue with file associations.

In Windows 7 and below I noticed that when I do right click on a file, select 'Open With' and choose my (or any) app, the current directory of the process that is launched is the same as the directory where the file I clicked on resides. This is the desired behavior.

But on Windows 10 I see that the current directory is getting set to System32, which is not really good since the app tries to write to Current Directory and gets permissions issues.

My first question is - is there any documentation for which Current Directory is being used in each case.

The second question is - is there some way to define in the registry the default Current Directory for certain file types or exes. Can I change the behavior of the openwith to be the same in Windows 10 as it is in previous versions?

Thanks!

解决方案

Hi,

You've got the current directory setting to System32 because when you select 'Open With', you are using the openwith.exe, and it is located at System32, you need to enable "Always use this app to *(file)", and open it again with double click . Then the current directory will change to your desired.

Best Regards,

Drake


这篇关于使用& amp;#39; Open With& amp; amp; amp; amp; amp; amp; amp; amp; amp; amp;#39;打开应用程序时,如何确定当前目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆