<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Функция "Очистка Диска" в Win 7]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=10877</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10877&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Функция "Очистка Диска" в Win 7».]]></description>
		<lastBuildDate>Wed, 19 Aug 2015 10:10:53 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96621#p96621</link>
			<description><![CDATA[<p>А ты про это... но когда парк более 20 компов + разные ОС + миграция... просто я уже много раз прокалывался, т.к. на сервере стартует BackUp, даёт сигнал по всем компам, ждёт, делает резервное копирование, а потом выясняется, что где то не та ОС и не так сработала очистка.</p><p>Если дома, то можно через <strong>/sageset:n</strong> и <strong>/sagerun:n</strong>, а вот на работе косяки получаются - постоянно приходится проверять, что у кого поменялось. <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Wed, 19 Aug 2015 10:10:53 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96621#p96621</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96619#p96619</link>
			<description><![CDATA[<p>Так serzh82saratov написал в 14 посту:<br /></p><div class="quotebox"><blockquote><p>И далее просто запускать с сохранёнными настройками</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Wed, 19 Aug 2015 10:01:35 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96619#p96619</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96617#p96617</link>
			<description><![CDATA[<p>Можно и так, что будет эквивалентно скрипту, только куда заносить, что бы он срабатывал по внешнему сигналу, а не по расписанию, а?<br />Просто я не знаю.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Wed, 19 Aug 2015 07:23:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96617#p96617</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96614#p96614</link>
			<description><![CDATA[<p>Так а в чем проблема?<br />Зеаносишь в реестр:<br /></p><div class="codebox"><pre><code>run cleanmgr.exe /d X: /sageset:n</code></pre></div><p>И он сохраняет настройки для нужного тебе диска (в sagerun диск указывать не надо поэтому и пишут, что Ключ /d не совместим с ключом /sagerun:./d ).</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Wed, 19 Aug 2015 03:10:17 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96614#p96614</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96592#p96592</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Пробовал на системном диске, не заметил, тогда не вариант.</p></blockquote></div><p> Да можно написать, но придётся создавать много профилей для ключа <strong>/sagerun</strong>, а для одного компа достаточно использовать этот ключ.</p><p><a href="https://support.microsoft.com/ru-ru/kb/315246">Служба поддержки Майкрософт (cleanmgr.exe)</a> </p><div class="quotebox"><blockquote><p>Средство очистки диска поддерживает следующие параметры командной строки.</p><p>&nbsp; &nbsp; /d driveletter. Выбор диска для очистки.</p><p>&nbsp; &nbsp; Примечание. Параметр /d игнорируется, если задан параметр /sagerun: n.</p></blockquote></div><p> Вот, по сути из за чего возникла необходимость написания скрипта.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Tue, 18 Aug 2015 20:03:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96592#p96592</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96591#p96591</link>
			<description><![CDATA[<p>Пробовал на системном диске, не заметил, тогда не вариант.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Tue, 18 Aug 2015 19:24:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96591#p96591</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96590#p96590</link>
			<description><![CDATA[<p><strong>serzh82saratov</strong> Одно уточнение. Ключ <strong>/d </strong>не совместим с ключом <strong>/sagerun:</strong>.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Tue, 18 Aug 2015 19:07:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96590#p96590</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96589#p96589</link>
			<description><![CDATA[<p>Есть ключи:<br /></p><div class="quotebox"><blockquote><p>Syntax<br />&nbsp; &nbsp; &nbsp;CLEANMGR option</p><p>Options<br />&nbsp; &nbsp; &nbsp; &nbsp;/d driveletter: Select the drive that you want Disk Cleanup to clean.</p><p>&nbsp; &nbsp; &nbsp; &nbsp;/sageset:n&nbsp; &nbsp; &nbsp; Display the Disk Cleanup Settings dialog box and create<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;a registry key to store the settings you select.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;The n value is stored in the registry and allows you to<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;specify different tasks for Disk Cleanup to run.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;n can be any integer from 0 to 65535.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Specify the %systemroot% drive to see all the available options.</p><p>&nbsp; &nbsp; &nbsp; /sagerun:n&nbsp; &nbsp; &nbsp; &nbsp;Run task &#039;n&#039;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;All drives in the computer will be enumerated, and the<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;selected profile will be run against each drive. </p><p>&nbsp; &nbsp; Only one of the 3 options above can be run at a time</p><p>&nbsp; &nbsp; &nbsp; /TUNEUP:n&nbsp; &nbsp; &nbsp; &nbsp; Run sageset + sagerun for the same n</p><p>&nbsp; &nbsp; &nbsp; /LOWDISK&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Run with the default settings.</p><p>&nbsp; &nbsp; &nbsp; /VERYLOWDISK&nbsp; &nbsp; &nbsp;Run with the default settings, no user prompts.</p><p>&nbsp; &nbsp; &nbsp; /SETUP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Undocumented<br />&nbsp; &nbsp; &nbsp; /Help&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Undocumented<br />&nbsp; &nbsp; &nbsp; /Usage&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Undocumented<br />&nbsp; &nbsp; &nbsp; /?&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Display help</p></blockquote></div><p>Если один раз запустить:</p><div class="codebox"><pre><code>run cleanmgr.exe /sageset: 1</code></pre></div><p>Поставить нужные отметки, нажать ок для сохранения настроек в реестр под номером 1.</p><p>И далее просто запускать с сохранёнными настройками:</p><div class="codebox"><pre><code>run cleanmgr.exe /d C: /sagerun: 1</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Tue, 18 Aug 2015 17:56:01 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96589#p96589</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96587#p96587</link>
			<description><![CDATA[<p>Ну да, вот проверка OS - может надо написать. </p><div class="codebox"><pre><code>SetTitleMatchMode 2
run %windir%\system32\cleanmgr.exe /d %Disc%:</code></pre></div><p> или </p><div class="codebox"><pre><code>SetTitleMatchMode 2
run %windir%\SysWOW64\cleanmgr.exe /d %Disc%:</code></pre></div><p> Но после компиляции поможет ли это - я не уверен, надо проверить.</p><p>P.S. Проверил - не помогает, запускает 32-х разрядную версию, если файл 32-x разрядный. <br />Ладно сделаем 3 файла, это не принципиально, а админка тут не причём, запускал с разных профилей... хотя боюсь что упустил, что на всех компах это профиль админский.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Tue, 18 Aug 2015 16:41:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96587#p96587</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96586#p96586</link>
			<description><![CDATA[<div class="quotebox"><cite>Indomito пишет:</cite><blockquote><p>P.S. Надо в скрипт вставить проверку OS на разрядность...</p></blockquote></div><p>Она есть в скрипте <em>A_IsUnicode</em>, но проверяло админку.</p>]]></description>
			<author><![CDATA[null@example.com (yalanne)]]></author>
			<pubDate>Tue, 18 Aug 2015 16:27:07 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96586#p96586</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96585#p96585</link>
			<description><![CDATA[<p>Не помогает, &quot;-2&quot; пункта по сравнению с консолью и самое главное не видит/не доходит до очистки обновлений.<br />Я и компилировал и так запускал, может нужно использовать другой bin в компиляции? <br />Например ANSI или по умолчанию?</p><p><strong>Ёкарный-бабай!!!</strong><br />У меня OS Windows 7 x64 - откомпилировал используя <strong>Unicode 64-bit.bin</strong> и всё заработало... да Windows это нечто. lol</p><p>P.S. Надо в скрипт вставить проверку OS на разрядность... вроде в AHK есть такая переменная + батник и два ЕХЕ-файла, т.е. не батник, а один стартовый, который запускает или x32 или x64 от типа разрядности OS.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Tue, 18 Aug 2015 15:54:08 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96585#p96585</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96584#p96584</link>
			<description><![CDATA[<div class="codebox"><pre><code>Check := &quot;1|3&quot;
Disc := &quot;C&quot;

ShellExecute := A_IsUnicode ? &quot;shell32\ShellExecute&quot;:&quot;shell32\ShellExecuteA&quot;  
if not A_IsAdmin
{
      If A_IsCompiled
         DllCall(ShellExecute, uint, 0, str, &quot;RunAs&quot;, str, A_ScriptFullPath, str, params , str, A_WorkingDir, int, 1)
      Else
         DllCall(ShellExecute, uint, 0, str, &quot;RunAs&quot;, str, A_AhkPath, str, &quot;&quot;&quot;&quot; . A_ScriptFullPath . &quot;&quot;&quot;&quot; . A_Space . params, str, A_WorkingDir, int, 1)
      ExitApp
}

SetTitleMatchMode 2
run %windir%\system32\cleanmgr.exe /d %Disc%:
WinWait % &quot; (&quot; Disc &quot;:&quot; &quot;) ahk_exe cleanmgr.exe&quot;
hwnd := WinExist(&quot; (&quot; Disc &quot;:&quot; &quot;) ahk_exe cleanmgr.exe&quot;)
ControlGet hwndctrl, Hwnd , ,SysListView321, % &quot;ahk_id &quot; hwnd
ControlGet, LVItems, List, ,,ahk_id %hwndctrl%
ControlSend,, {Down}, ahk_id %hwndctrl%
Loop, parse,LVItems,`n
    {
    SendMessage, 0x102C, A_Index - 1, 0x2000,, ahk_id %hwndctrl% ; LVM_GETITEMSTATE
    if ErrorLevel
        ControlSend,, {Space}, ahk_id %hwndctrl%
    if (A_Index ~= &quot;^(&quot; Check &quot;)$&quot;) or !Check
        ControlSend,, {Space}, ahk_id %hwndctrl%
    ControlSend,, {Down}, ahk_id %hwndctrl%
    }
    
ControlSend,, {Enter}, ahk_id %hwnd%
sleep 100
Send {Enter}
</code></pre></div><p>Вот запуск с админкой + косяки с галочками исправил.</p>]]></description>
			<author><![CDATA[null@example.com (yalanne)]]></author>
			<pubDate>Tue, 18 Aug 2015 15:37:12 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96584#p96584</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96582#p96582</link>
			<description><![CDATA[<p>Так... нашёл ещё один прикол, но с чем он связан я не понял.</p><p>При обычной очистке - 12 пунктов.<br />При программной всего 5 пунктов.</p><p>Может нужен <em>&quot;Запуск от имени администратора&quot;</em>?</p><p><strong>UPD</strong></p><p>Перепробовал всё... не помогает.</p><p>Блин, забыл - Запуск из ком.процессора, это последнее что я не проверил.</p><p>Всё - не понимаю что не так, т.е. скрыты пункты которые можно очистить.</p><p>bat-файл выдаёт тоже самое, т.е. скрывает пункты, только запуск <strong>CMD.exe -&gt; cleanmgr.exe /d c:</strong> показывает все пункты.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Tue, 18 Aug 2015 14:46:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96582#p96582</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96581#p96581</link>
			<description><![CDATA[<div class="codebox"><pre><code>Check := &quot;1|2&quot;
Disc := &quot;E&quot;

SetTitleMatchMode 2
run %windir%\system32\cleanmgr.exe /d %Disc%:
WinWait % &quot; (&quot; Disc &quot;:&quot; &quot;) ahk_exe cleanmgr.exe&quot;
hwnd := WinExist(&quot; (&quot; Disc &quot;:&quot; &quot;) ahk_exe cleanmgr.exe&quot;)
ControlGet hwndctrl, Hwnd , ,SysListView321, % &quot;ahk_id &quot; hwnd
ControlGet, LVItems, List, ,,ahk_id %hwndctrl%
ControlSend,, {Down}, ahk_id %hwndctrl%
Loop, parse,LVItems,`n
    {
    SendMessage, 0x102C, A_Index - 1, 0x2000,, ahk_id %hwndctrl% ; LVM_GETITEMSTATE
    if ErrorLevel
        ControlSend,, {Space}, ahk_id %hwndctrl%
    if (A_Index ~= &quot;^&quot; Check &quot;$&quot;) or !Check
        ControlSend,, {Space}, ahk_id %hwndctrl%
    ControlSend,, {Down}, ahk_id %hwndctrl%
    }

ControlSend,, {Enter}, ahk_id %hwnd%
sleep 100
Send {Enter}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (yalanne)]]></author>
			<pubDate>Tue, 18 Aug 2015 14:37:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96581#p96581</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Функция "Очистка Диска" в Win 7]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96580#p96580</link>
			<description><![CDATA[<p>Так...</p><p>Написал. </p><div class="codebox"><pre><code>Check := &quot;1|4|5&quot;

SetTitleMatchMode 2
run %windir%\system32\cleanmgr.exe /d C:
WinWait Очистка диска  (C:) ahk_exe cleanmgr.exe</code></pre></div><p> Выбрались все пункты, что ты не учёл... пытаюсь разобраться.</p><p>И концовка не срабатывает, т.е. не нажатия на ОК. </p><div class="codebox"><pre><code>ControlSend,, {Enter}, ahk_id %hwnd%
sleep 100
Send {Enter}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Tue, 18 Aug 2015 14:24:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96580#p96580</guid>
		</item>
	</channel>
</rss>
