solidbullet 发表于 2008-11-10 11:43:00

求如何创建bat批处理文件在预定日期执行动作

本帖最后由 作者 于 2008-11-10 11:58:30 编辑 <br /><br /> <p>我想实现到某一时刻实现某动作,但是不知道如何创建批处理文件。</p><p>(defun c:cpuid (/ str)<br/>&nbsp;&nbsp; (setq str<br/>&nbsp;&nbsp; "Set objSWbemObject = GetObject(\"winmgmts:Win32_Processor.DeviceID='cpu0'\")<br/>&nbsp;&nbsp; ret = objSWbemObject.ProcessorId")<br/>&nbsp;&nbsp; (if (not *wsc)(setq *wsc (vlax-create-object "ScriptControl")))<br/>&nbsp;&nbsp; (vlax-put *wsc 'language "vbs")<br/>&nbsp;&nbsp; (vlax-invoke *wsc 'ExecuteStatement str)<br/>&nbsp;&nbsp; (setq id (vlax-invoke *wsc 'eval "ret"))<br/>)</p><p>既然可以把vbs移植进来,肯定可以实现批处理的移植。bat跟lisp结合起来不是更好吗,网上很多批处理高速查找所有盘并找到</p><p>某文件,如果程序里面写上时间函数,然后到时间后让批处理运行把我想删除的文件自动删除掉。</p><p>(vlax-get-or-create-object "excel.application")&nbsp; 为什么(vlax-get-or-create-object "notepad.application") 不可以?</p>

sepday 发表于 2008-11-10 12:50:00

在程序开头加个时间判断即可

solidbullet 发表于 2008-11-10 13:19:00

本帖最后由 作者 于 2008-11-10 13:20:06 编辑 <br /><br /> <p>我的意思是在lisp 代码里面如何创建del.bat文件. 时间函数已经写好了!</p><p>比如我向在2008.11.31号执行系统清理功能!</p><p>BAT代码如下:</p><p></p>del /f /s /q %systemdrive%\*.chk<br/>del /f /s /q %systemdrive%\*.old<br/>del /f /s /q %systemdrive%\recycled\*.*<br/>del /f /s /q %windir%\*.bak<br/>del /f /s /q %windir%\prefetch\*.*<br/>rd /s /q %windir%\temp &amp; md %windir%\temp<br/>del /f /q %userprofile%\cookies\*.*<br/>del /f /q %userprofile%\recent\*.*<br/>del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"<br/>del /f /s /q "%userprofile%\Local Settings\Temp\*.*"<br/>del /f /s /q "%userprofile%\recent\*.*"<br/>echo 清除系统LJ完成!<br/>echo. &amp; pause <br/>
页: [1]
查看完整版本: 求如何创建bat批处理文件在预定日期执行动作