M mailx7 Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-25 #1 如何返回当前目录? 我要制作一个窗口,点击上面的按钮,开始运行当前目录下的setup.exe程序,如何做?
扳 扳手 Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-25 #2 extractfilepath(application.exename) 得到当前可执行文件的路径
扳 扳手 Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-25 #4 当前正在运行的可执行文件文件名。 如你当前运行的程序为project1.exe。
X xianjun Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-25 #5 直接ShellExecute(handle, 'open', 'setup.exe'.... 即可 Windows会先从当前目录找起的!
M mailx7 Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-25 #7 pht:=extractfilepath(application.Menu_xp.exe); 我这样写的,但不可运行? [Error] Unit1.pas(129): Undeclared identifier: 'Menu_xp'
pht:=extractfilepath(application.Menu_xp.exe); 我这样写的,但不可运行? [Error] Unit1.pas(129): Undeclared identifier: 'Menu_xp'
南 南宫吹云 Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-25 #8 对,也可以用winexec('setup.exe',sw_normal);
南 南宫吹云 Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-25 #9 pht:=extractfilepath(application.exename);
张 张辉明 Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-25 #10 application.exename就是当前运行的EXE文件的绝对路径的文件名。
Y yanghai0437 Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-25 #11 extractfilepath(application.exename)
扳 扳手 Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-25 #13 procedure TForm1.Button1Click(Sender: TObject); var a:string; begin a:=extractfilepath(application.exename)+'setup.exe'; shellexecute(0,'open',pchar(a),0,0,sw_normal); end;
procedure TForm1.Button1Click(Sender: TObject); var a:string; begin a:=extractfilepath(application.exename)+'setup.exe'; shellexecute(0,'open',pchar(a),0,0,sw_normal); end;
J jieson Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-25 #14 var path:array [0..255] of char; GetCurrentDirectory(sizeof(path),path); winexec();//要执行的文件