jeudi 25 avril 2019

Call windows exe file from rails application

I am calling exe file from rails application.I have set-up rails application over windows machine and from code I am running exe file.In this I need to pass a path in the arguments.

@project = Project.find(params[:project_id])
xml_file_path = @project.xml_file_name
basename = File.basename(xml_file_path) i.e "12.xml"

Tried this -

final_xml_path = "C:\Windows\System32\workspace\preference\public\xml_files\#{basename}"

I have tried this -

 final_xml_path = 'C:\\Windows\\System32\\workspace\\preference\\public\\xml_files\\#{basename}'

Output - p final_xml_path

"C:\\Windows\\System32\\workspace\\preference\\public\\xml_files\\\#{basename}" 

Desired output -

final_xml_path = "C:\Windows\System32\workspace\preference\public\xml_files\12.xml"

I need this output I need to pass in the arguments while running exe file.

Aucun commentaire:

Enregistrer un commentaire