BSOD2600
27th July 2006 06:09 UTC
Problem executing long command
I'm trying to execute a bunch of MySQL commands I've put into a file (batch.txt). I can't seem to get Execdos to execute it properly
ExecDos::exec /TIMEOUT=5000 "$INSTDIR\mysql\bin\mysql.exe --user=root --password=cacti --database=cacti < $TEMP\batch.txt" "" "$INSTDIR\Inetpub\wwwroot\cacti\log\rrdtoolpath.log"
Pop $0 ; exit code
MessageBox MB_OK "Exit code $0"
or
ExecDos::exec /TIMEOUT=5000 '"$INSTDIR\mysql\bin\mysql.exe" --user=root --password=cacti --database=cacti < $TEMP\batch.txt' "" "$INSTDIR\Inetpub\wwwroot\cacti\log\rrdtoolpath.log"
Pop $0 ; exit code
MessageBox MB_OK "Exit code $0"
Do not work. The output simply lists the MySQL commands. Is there any way I can see what execdos is trying to do?
BSOD2600
27th July 2006 06:48 UTC
Bah, fixed it:
ExecCmd::exec /TIMEOUT=5000 "$INSTDIR\mysql\bin\mysql.exe --user=root --password=cacti --database=cacti < $TEMP\batch.txt" ""
Takhir
27th July 2006 07:04 UTC
Input redirection is a shell option so you can add:
ReadEnvStr $R0 COMSPEC
ExecDos::exec '$R0 /C /TIMEOUT=5000 '"$INSTDIR\mysql...
to your command line (%COMSPEC% not worked here in my tests).
ExecCmd adds comspec by default.
Afrow UK
27th July 2006 10:35 UTC
Make sure you put quotes around the path to execute:
'"$INSTDIR\mysql\bin\mysql.exe" --user=root --password=cacti --database=cacti < "$TEMP\batch.txt"' ""
If $INSTDIR or $TEMP contain spaces your command will likely fail.
E.g. if $INSTDIR is C:\Program Files\MyApp, then without the quotes, ExecDos will try to execute "C:\Program" which isn't a file, nor even a folder!
-Stu