Search code examples
batch-filensis

How can I run a .bat file with parameter in NSIS installer


I am trying to write a script which run a mysqlimport_create_database.bat file with parameter.

script of batch file C:\"Program Files (x86)"\jasperreports-server-cp-4.0.0\mysql\bin\mysql.exe -u root -p < create_database.sql

So when I run this batch file,it asks for password, I want to add a parameter for password.

My NSIS script to run batch file and pass a password as a parameter

ExecWait '"$INSTDIR\mysqlimport_create_database.bat" "password"'

How can i pass the password as a parameter?


Solution

  • I have solved the problem, the problem was in batch file we can add password also in same batch file ,like this--if the password is "root" C:\"Program Files (x86)"\jasperreports-server-cp-4.0.0\mysql\bin\mysql.exe -u root -proot < create_database.sql