要把程序做成用户自定义是否开机启动,cmd命令已经写好了,但是不知道弄
不想让godot调启.bat运行,想让godot直接调用cmd运行命令
😅 直接让用户自行运行CMD 不就OK了
zuiaiyangyang3 宁是在搞笑吗🤨
试试 OS.shell_open("res://") or OS.execute("Write-Host 'hello world'")?
OS.shell_open("res://")
OS.execute("Write-Host 'hello world'")
到家测试了一下,是这样用的:
func unit_test_cmd(): var output = [] var exit_code = OS.execute("CMD.exe", ["/C", "echo hello world"], true, output) if exit_code == OK: for line in output: print(line) func _ready(): unit_test_cmd()
time2beat 好的,谢谢