英文:
Opening txt files with default windows text editor in golang
问题
我想使用默认的文本编辑器应用程序打开txt文件,但我不知道Windows存储应用程序和文件格式关联的位置。例如,在类Unix系统中,有一个名为$EDITOR的环境变量,用于存储默认编辑器的路径。
我进行了很多研究,但是找不到任何信息。
提前感谢。
英文:
I want to open txt files using default text editor application that set for, but I don't know where windows stores the application and file format associative. for example in Unix-like systems there is an enjoinment variable called $EDITOR that stores the path to default editor.
I did a lot of research but I couldn't find anything
thanks in advance
答案1
得分: 2
我找到了如何在Windows中使用默认应用程序打开文件的方法。你只需要打开文件本身即可。看一下下面的示例:
exec.Command("cmd", "/c", "sample.txt")
英文:
I figure out how to open files with default apps in windows. All the things you need to do is opening file by its own. take a look at below example.
exec.Command("cmd", "/c", "sample.txt")
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论