How can we pass parameter to batch file?


#1

b = "\r\n"
y = “Y”

batch “run-script” do
cwd "D:\oracle\product\root2\OPatch\ocm\bin"
code "emocmrsp.bat param1=#{b} param2=#{y}"
action :run
end


#2

This is not an appropriate question. Please read https://stackoverflow.com/help/how-to-ask for help in asking a question, and https://stackoverflow.com/help/mcve for help in constructing an example and providing sufficient information.


#3

b = "\r\n"
y = “Y”

batch “run-script” do
cwd "D:\oracle\product\root2\OPatch\ocm\bin"
code "emocmrsp.bat param1=#{b} param2=#{y}"
action :run
end

Actually what i am trying to do here is to go to directory where my batch file is kept that is emocmrsp.bat and that file need two inputs that are b and y parameters or variables . so i want to ask how can pass variable to a batch file because this is not working like this.


#4

first try manually how to pass the parameters in a batch file…Then keep that command as it is in powershell_script module.


#5

that is very commonly known but is there any exact solution. Beacuse i have already tried alot. Is anyone who have try this