Using wxWidgets-2.8.11 on windows XP (no need for portability in this case) I am trying to get my program to start a vb-script file that requires two arguments when it is done. I have tried quite a couple of possible ways to do create a string with the command name and the arguments for wxExecute, but I have to admit I just don't really understand how I can use wxExecute.
The arguments required are a string with the path to the directory where a file can be found and a string with the name of the file.
This is how I am trying to do it now:
Code: Select all
wxExecute(wxString::Format(_("clean_logfile.vbs \"%s\" \"%s\" NULL"), wxFileName(fileName).GetPath().mb_str(), wxFileName(fileName).GetFullName().mb_str()));
- clean_logfile.vbs is the vb-script that is stored in the same directory as my executable
- fileName is a wxString with the full name of the file I want the script to handle.
The vb-script works if I call it with this command in a bat file: clean_logfile.vbs "." "Logfile_20130314_163010.dat.130315161044.csv" and the specified file is also present in the same directory. Obviously I don't want to be restricted to the same directory and this specific filename, so I can't hard code it, so I used wxWidgets to simply browse to a file and select it. This is how I get the fileName variable.
If there is anyone who knows what I should change or could try the advise would be greatly appreciated.
Kind regards, Nico