【问题标题】:How to set vlc player as default player in windows programmatically?如何以编程方式将 vlc 播放器设置为 Windows 中的默认播放器?
【发布时间】:2018-08-03 21:23:15
【问题描述】:

我想将 vlc 播放器设置为 windows 操作系统上 mp3 文件的默认播放器。例如,如果我通过命令运行 mp3 文件,它应该通过 vlc 播放器播放。

是否有任何命令行或注册表设置可用于将 vlc 设置为 Windows 中的默认播放器?

谢谢

【问题讨论】:

    标签: python windows registry mp3 vlc


    【解决方案1】:

    这样的东西可能可以工作,但我还没有测试过。

    这个程序应该在 python 脚本中运行 windows 命令。

    import os
    
    os.system('assoc .mp3=mp3')
    os.system('FTYPE mp3=PATH/TO/VLC.exe')
    

    这取自Microsoft forums

    Use FTYPE {fileType}={commandString} to create a file type and associated command to open the file.
    Use ASSOC {.fileExtension}={fileType} to associate a file extension with the file type you created.
    

    【讨论】:

    • 这个答案有帮助吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-13
    • 1970-01-01
    • 2012-05-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多