Shellexecute avec espace dans le path

Résolu
PhilLu Messages postés 251 Date d'inscription lundi 9 novembre 2009 Statut Membre Dernière intervention 11 mai 2021 - 27 mars 2014 à 14:10
PhilLu Messages postés 251 Date d'inscription lundi 9 novembre 2009 Statut Membre Dernière intervention 11 mai 2021 - 27 mars 2014 à 22:02
Bonjour,
J'utilise le code suivant qui marche bien temps que le path ne contient pas d'espace:
var cmd: string;
cmd := '+h +r ' + extractFilePath(application.exename)+ proj +'.phl';
ShellExecute(handle, nil, 'attrib',PChar(cmd),nil,sw_shownormal);
J'ai tenté des variations en suivant les infos sur le net mais sans résultat
(du style double quote...)
Comment m'en sortir???
Merci pour vos idées

3 réponses

Technix59 Messages postés 32 Date d'inscription vendredi 13 décembre 2002 Statut Membre Dernière intervention 29 mars 2014
27 mars 2014 à 16:35
Un ShellExecute(handle, nil, 'attrib', PChar(QuotedStr(cmd)), nil, sw_shownormal) donne t-il satisfaction ?
0
PhilLu Messages postés 251 Date d'inscription lundi 9 novembre 2009 Statut Membre Dernière intervention 11 mai 2021
27 mars 2014 à 19:58
Ben non :-/
0
PhilLu Messages postés 251 Date d'inscription lundi 9 novembre 2009 Statut Membre Dernière intervention 11 mai 2021
27 mars 2014 à 22:02
Voici la solution:
cmd := '-h ' +'"'+ extractFilePath(application.exename)+ proj +'.phl"';
ShellExecute(handle, nil, 'attrib',PChar(cmd),nil,sw_shownormal);
Merci pour ta proposition
0
Rejoignez-nous