你可以动态生成一个CMD文件啊,然后执行它

解决方案 »

  1.   

    这样的:winexec(pchar('e:\ kqgl>  copy\\2111(机器名)\kqgl\kqgl.mdb /y'),sw_hide);
      

  2.   

    bob7946(X度空间) 
     你好!我把你的语句加入后,点击后怎么设置提示,数据库更新完成呢?不过,好象这个语句没有执行。
      谢谢,请告诉我是哪儿做的有问题,好吗?
      

  3.   

    if
     winexec(pchar('e:\kqglxt>  copy\\2111\数据库更新\dbkqgl.mdb /y'),sw_hide)=true
           then
           showmessage('数据库更新已完成!')
    else
           showmessage('数据库更新未完成!')不好意思,以上的语句是不是有很大的问题,但是我不知道该怎么写,请改正。
      

  4.   

    都说了把你执行的DOS命令写到一个 cmd 文件里,然后 shellexecute 它,就可以了。基本上MS的安装程序都是用这些方法,不过他们是写一些VBSCRIPT
      

  5.   

    anggogo(angGoGo) :
    不好意思,我还是不懂耶,能不能写一下,谢谢你了,我太笨了。
      

  6.   

    用语句生成一个 cmd 文件,CMD 是在DOS上运行的命令行文件。往这个文件里写你要运行的所有命令,包括什么 copy del 之类的,然后 shellexecute 这个文件就可以
      

  7.   

    runstr:='isql -S ' + sname + ' -i ' + pUnit.getPath + '\database\createdb.sql -U ' + uname + ' -P ' + upwd;
          AssignFile(F1,getPath + '\database\setup.cmd');
          rewrite(f1);
          write(f1,runstr);
          closeFile(f1);
          If MessageBox(0,'Are you ready to create database?' + #13+#13 + 'Remember:'+#13+'    If you had already created,redo this will destroy all your data.','Message',MB_YESNO)=IDYES then
            begin
              Messagebox(0,' Please wait a several seconds... ','Message',MB_OK);
              ShellExecute(0,'',PChar(pUnit.getPath + '\database\setup.cmd'),nil,nil,SW_NORMAL);
            end;
      

  8.   

    The CreateProcess function creates a new process and its primary thread. The new process executes the specified executable file. BOOL CreateProcess(    LPCTSTR lpApplicationName, // pointer to name of executable module 
        LPTSTR lpCommandLine, // pointer to command line string
        LPSECURITY_ATTRIBUTES lpProcessAttributes, // pointer to process security attributes 
        LPSECURITY_ATTRIBUTES lpThreadAttributes, // pointer to thread security attributes 
        BOOL bInheritHandles, // handle inheritance flag 
        DWORD dwCreationFlags, // creation flags 
        LPVOID lpEnvironment, // pointer to new environment block 
        LPCTSTR lpCurrentDirectory, // pointer to current directory name 
        LPSTARTUPINFO lpStartupInfo, // pointer to STARTUPINFO 
        LPPROCESS_INFORMATION lpProcessInformation  // pointer to PROCESS_INFORMATION  
       );
     
      

  9.   

    呵呵,有必要那么夸张用到API吗?只不过执行DOS脚本
      

  10.   

    anggogo(angGoGo) 
    你好!
    我是要把这个功能加到程序里,好象是要调用外部函数的,是不是啊?
    要不你教的语句要加到哪儿啊