如何让我的脚本在插入 USB 时自动运行?

Whi*_*dow 5 python autorun windows-10

我的 USB 中有以下 python 文件:

Game.py
Run Code Online (Sandbox Code Playgroud)

我想让它在插入 USB 时自动运行。

我在记事本中写下了以下内容:

[autorun]

shellexecute=Game.py
action=MyProgram Open Program
Run Code Online (Sandbox Code Playgroud)

并将其另存为autorun.inf.

但它不运行并且我的电脑显示:

该驱动器有问题。现在扫描并修复它吗?

出了什么问题,我该如何解决这个问题?

注意:
我使用的是 Windows 10。

小智 1

嗨,我自己是初学者,但这应该可以解决问题

[autorun]
;Open=YOURAPP.exe
ShellExecute=YOURAPP.exe
UseAutoPlay=1
Run Code Online (Sandbox Code Playgroud)