Command du fichier exe

fabiin - 31 mars 2001 à 21:03
 int19h - 31 mars 2001 à 21:21
Salut !,
lorsque l'utilisateur de mon progs le lance comme ca :
prog.exe c:fichier.txt
comment faut faire pour pouvoir connaitre le chemin du fichier ??? :question)

Merci !
@+
Fabs

1 réponse

En faite, tu veux passer a ton programme la ligne de commande. Utiliser la fonction : Command$

Place ce code dans ton code :

sub Form_Load

z$=Command$
if z$<>"" then
   do while z$<>""
   if instr(z$," ") then
         a$=mid$(z$,1,instr(z$," ")-1)
         z$=mid$(z$,instr(z$," ")+1)
   else
         a$=z$
         z$=""
   end if

   ' Ici dans a$ tu as le nom du fichier
   MsgBox "Fichier : " & a$
   Loop
end if



La fonction Do...Loop permet la gestion de plusieur fichier :
Prog.exe c:Table1.txt c:
epprogr.txt

Question en direct : int19h@usa.net

a+
0
Rejoignez-nous