急急急﹐文件定时执行的问题(很简单的)﹖﹖(30分)

  • 主题发起人 主题发起人 梦空
  • 开始时间 开始时间

梦空

Unregistered / Unconfirmed
GUEST, unregistred user!
在公司﹐没有家里的delphi资料﹐但遇上问题。请教一个简单问题
执行一个已编好的exe文件的语句是怎幺写﹖好象是ex~~~~﹐后面的参数忘记了。
还有﹐对于时间问题﹐如在7点钟的时候执行它﹐是用什幺工具比较好﹖﹖是用timer还是用其它的工具或语句﹖﹖﹖
因为要每天执行一次﹗我担timer会出错。
另一个问题是﹕执行exe时要带参数﹐如星期一执行时带一个参数﹐星期二带另一参数﹐请教﹗﹗﹗
 
uses WinProcs;
.....
begin
WinExec(......);
.........
end.

和调用Pascal库函数没什么两样。

例如:
WinExec('c:/windows/myExe.exe 参数',SW_SHOWNORMAL); //启动计算器
函数原型为:
UINT WinExec(
LPCSTR lpCmdLine, // address of command line
UINT uCmdShow // window style for new application
);

 
Winexec('notepad.exe aa.txt',1)
定时执行可用系统的 计划任务

参数问题,我没试过。
 
[:)]再问一个问题﹕我用edit控件来获取参数﹐如要执行的文件的路径和文件名﹐直接用
var
pathstring:string
pathstring:=edit1.text;
WinExec(pathstring,SW_SHOWNORMAL);
提示出错﹕[Error] Unit1.pas(59): Incompatible types: 'String' and 'PChar'
再次求救﹕如何解决这个问题
怎样把string变成pchar类型
 
WinExec(....,SW_NORMAL);
 
wait you ask for online!!!!!!!!!please help me!!!
 
WinExec(pchar(pathstring),SW_SHOWNORMAL);
就可以乐!
 
thank's DFW!!!!!!!!!! and DFW's friend!!!!!!!!!!
 
后退
顶部