如何将参数传递给可执行文件 [英] how to pass an argument to an executable file

查看:98
本文介绍了如何将参数传递给可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好开发人员我需要一个关于如何将参数传递给可执行文件的解决方案。

所以在main方法中我可以存储已经传递给可执行文件的值



p = 10



oWsh = CREATEOBJECT(wscript.shell)

oWsh.Run(myexecutable.exe)



i想要将变量p中的值10传递给可执行文件。

hello developers i need a solution on how to pass an argument to an executable file.
so that in the main method i can store the values that have been passsed to the executable

p=10

oWsh = CREATEOBJECT("wscript.shell")
oWsh.Run("myexecutable.exe" )

i want to pass the value 10 in variable p to the executable file.

推荐答案

只需将参数添加到运行方法。例如

Just add the parameter to the first argument of the Run method. e.g.
oWsh.Run("myexecutable.exe " + p.ToString() )





请参阅:运行方法(Windows脚本宿主) [ ^ ]


试试这个。

Try this.
oWsh.Run("myexecutable.exe " & p)


这篇关于如何将参数传递给可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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