05-30-2012 07:55 AM
Hi,
I am using launchexecutable() to open a .ini file in notepad.
If i specify the path name as launchexecutable(NOTEPAD.EXE D:\\Documents and Settings\\T0128779\\Bureau\\filename.ini) the file opens perfectly. The problem i have is that i have a string that stores the path name but without two slashes between for example the string contains the path name as D:\Documents and Settings\T0128779\Bureau\filename.ini
launchexecutable doesnt seem to work with this string. What am i doing wrong?
Thanks,
Rohit
Solved! Go to Solution.
05-30-2012 09:17 AM
just to add the string is created using GetDir() and MakePathName(,,)
so my question really is will launchexecutable() work with a path name that has only one slash between directories and if not how do i add a second slash? thanks a ton;
05-30-2012 09:40 AM
05-30-2012 10:08 AM
Hi Wolfgang, thanks for the link. I used Wendy's method and now my string has two slashes but still isnt working.
When i pass the path through the string i get the msg 'Cannot find file filename.ini Do you want to create it?'
But when i pass the path directly without the string the file opens. Could it be the quotes "" in the string?
Thanks
05-30-2012 10:23 AM
Yes, in the argument of LaunchExecutable you should enclose the file name in quotes because it contains spaces.
05-30-2012 02:25 PM
yes this is how i have it..
launchexecutable("NOTEPAD.EXE stringname")
but the stringname also has the path in quotes is that the problem?
05-30-2012 03:03 PM
@sinnas wrote:
launchexecutable("NOTEPAD.EXE stringname")
This will not work. You should have a look at the CVI examples using LaunchExecutable. There you will find how to do it:
sprintf (tempstr, "Notepad.exe %s", stringname);
LaunchExecutable (tempstr);
05-30-2012 03:16 PM
oh great thank you!!