![]() |
#1 | |
Junior Member
Join Date: Feb 2011
Posts: 7
|
![]()
Hi,
I'm looking for a way to handle input data redirection in ExecDos::exec. Thanks to some threads in the forum, I already found a way to redirect output. I wanted to do this in DOS : code: which gives this syntax in NSIS : code: Well... great! But now I need to do it the opposite way, which would be, in DOS : code: I tried a lot of different syntaxes until now with ExecDos::exec and ExecWait but couldn't make it work... I tried this, among other things (this attempt looked the most promissing one ![]() code: > Output in log.txt : Quote:
Any idea how I could do this? Is something like this possible? Thank you Valentin |
|
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Run it with cmd.exe (read COMSPEC to get its path).
Stu |
![]() |
![]() |
![]() |
#3 |
Major Dude
Join Date: Feb 2007
Posts: 672
|
The second parameter is the stdin.
You'll have to read the content of the file WebData.sql into a variable, and set that variable as the second parameter. But the length of an NSIS string is limited, so maybe the best way would be the one suggested by Stu. |
![]() |
![]() |
![]() |
#4 |
Junior Member
Join Date: Feb 2011
Posts: 7
|
![]()
Thanks to your answers and to the post here, I got it to work! Thank you!
So here are my lines now, using ExecCmd (as I understood that ExecCmd already includes the call to cmd.exe with COMSPEC) : code: It works great this way, but if I put quotes around $PLUGINSDIR\WebData and/or around $PLUGINSDIR\newSql.sql, it fails... Any idea why? I'm afraid it'd fail if $PLUGINSDIR has a space in its name on the machine it gets installed... is there a risk? Thank you! Valentin |
![]() |
![]() |
![]() |
#5 |
Major Dude
Join Date: Mar 2003
Posts: 571
|
I use nsExec::Exec and %COMSPEC% to run sqlite3.exe and I have no trouble using quotes around the input and output files for the .dump command.
|
![]() |
![]() |
![]() |
|
Tags |
execdos, execwait, input, redirect |
Thread Tools | Search this Thread |
Display Modes | |
|
|