max_max_08
Цитата max_max_08:
сделать счет по дням после первого запуска »
|
Можно "извратиться" так:
Код:
![Выделить весь код](images/misc/selectcode.png)
@Echo Off
Set DayLimit=10
Echo On Error Resume Next>~tmp.vbs
Echo Set WshShell = WScript.CreateObject("WScript.Shell")>>~tmp.vbs
Echo nDate = WshShell.RegRead("HKLM\Software\MyProgram\")>>~tmp.vbs
Echo If nDate = "" Then>>~tmp.vbs
Echo nDate = Now>>~tmp.vbs
Echo WshShell.RegWrite "HKLM\Software\MyProgram\", nDate>>~tmp.vbs
Echo End If>>~tmp.vbs
Echo If DateDiff("d", nDate, Now) ^> %DayLimit% Then WScript.Echo "Limit">>~tmp.vbs
For /F %%A In ('CScript ~tmp.vbs //Nologo') Do If /I "%%A"=="Limit" GoTo :EOF
Del /F /Q ~tmp.vbs>Nul
![Smile](images/smilies/new/smile.gif)