Calling Python script with arguments from VBscript -
i have python script 2 arguments , run via vbscript. problem when type command manually in windows command line, works without problem. when want phone call same script .vbs file, doesn't run .py file. new command window appears , disappears quickly. scripts in .vbs :
set oshell = wscript.createobject("wscript.shell") currentcommand = "d:\xxxx\xxxxx.py aaaa bbbbbbb" wscript.echo currentcommand oshell.run currentcommand,1,true
there no difference when add together "python" currentcommand. tried this:
set oshell = wscript.createobject("wscript.shell") dim source_code_path source_code_path = "d:\xxxx\xxxxx.py" dim variable1 variable1 = "aaaa" dim variable2 variable2 = "bbbbbbb" dim currentcommand currentcommand = source_code_path & " " & variable1 & " " & variable2 wscript.echo currentcommand oshell.run currentcommand,1,true
how can call/run .py file several arguments .vbs file?
note : when call/run .py without argument, working fine.
try changing to:
currentcommand = "cmd /c " & chr(34) & source_code_path & " " & variable1 & " " & variable2 & chr(34)
python vbscript
No comments:
Post a Comment