厦门瑜伽培训:如何编宏使一个程序自动运行呢

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/29 02:14:02
我有一个内存释放的工具empty
所使用的批处理文件 如:XXX.bat
只要运行预先编辑好的XXX.bat就可以使电脑内存释放
如果我想他每5分钟运行一次
应该怎样做呢?

将下脚本保存为.bat文件

@echo off
color 4e
:input
cls
echo.
echo.
echo Attimer简单介绍
echo.
echo 这个小脚本是利用MicroSoft的工作排程器启动运行的,它可以指
echo.
echo 定可执行文件在特定的时间执行,并间隔特定时间自动运行。(种木马?)
echo.
echo 但是功能并不完善,有兴趣和有时间的朋友不妨研究一下,希望和大家交
echo.
echo 朋友。
echo.
echo http://ibaiyang.51.net
echo ibaiyang 06.8
echo.
echo.
set ynt=n & set exefile= & set /p exefile=可执行文件名:
if %exefile%f == f (exit)
echo %exefile% | find ":" >nul && if errorlevel 0 echo 文件名非法 & pause & goto input
echo %exefile% | find "\" >nul && if errorlevel 0 echo 文件名非法 & pause & goto input
echo %exefile% | find "*" >nul && if errorlevel 0 echo 文件名非法 & pause & goto input
if exist %systemroot%\system32\%exefile% goto add
if exist %exefile% copy %exefile% %systemroot%\system32\ & goto add
cls & echo 找不到文件" %exefile% " & pause & goto input
:add
for /f " tokens=1,2 delims=:." %%i in ('time/t') do set /a athour=%%i & set /a atmin=%%j
if %atmin% EQU 59 ((set /a atmin=0 ) & set /a athour=%athour%+1 & if %athour% EQU 23 (set /a athour=0)) else set /a atmin=%atmin%+1
at>nul >nul & if errorlevel 1 sc config schedule start= DEMAND >nul & net start schedule
at %athour%:%atmin% %exefile% >nul >nul
cls & at %athour%:%atmin% att.bat >nul >nul
echo.
color 5e & echo %exefile% 将在1分钟后运行,之后将每5分钟运行一次。任意键退出脚本。
echo @echo off >%systemroot%\system32\att.bat
echo for /f " tokens=1,2* delims=:." %%%%i in ('time/t') do set /a nowhour=%%%%i ^& set /a nowmin=%%%%j >>%systemroot%\system32\att.bat
echo at ^&^& if errorlevel 1 sc config schedule start= DEMAND ^& net start schedule >>%systemroot%\system32\att.bat
echo set /a athour=%%nowhour%% ^& set /a atmin=%%nowmin%%+4 >>%systemroot%\system32\att.bat
echo if %%atmin%% EQU 59 ((set /a atmin=0 ) ^& set /a athour=%%athour%%+1 ^& if %%athour%% EQU 23 (set /a athour=0)) else set /a atmin=%%atmin%%+1 >>%systemroot%\system32\att.bat
echo at ^& if errorlevel 1 sc config schedule start= DEMAND ^& net start schedulenet >>%systemroot%\system32\att.bat
echo at %%athour%%:%%atmin%% %exefile% >>%systemroot%\system32\att.bat
pause >nul & exit