On Wed, Jul 29, 2015 at 3:58 PM, Dimitri Yioulos <dyiou...@gmail.com> wrote:

> Peter,
>
> Thanks for the response.
>
> I understand about Windows and quoting.  I've tried a number of quoting
> options, all with the same result.  When I applied your suggestion about
> escaping the backslashes, then ran the manifest, here's what I got:
>
> Info: Caching catalog for 1pointmailer.netatlantic.com
> Info: Applying configuration version '1438202725'
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: The
> operation
> completed successfully.
> Notice: /Stage[main]/Win_autodiskclean/Exec[sageset.bat]/returns: executed
> succe
> ssfully
> Notice: Finished catalog run in 1.51 seconds
>
> That's a success for each registry change in the batch file.  Nonetheless,
> "cleanmgr /d c: /sageset:100" still shows none of the boxes checked.  I've
> gotten the same results regardless of how I've used quotes (really misused
> quotes produce errors where flattening is very obvious).
>
> I appreciate the suggestion about using the registry module, but it seems
> to me that being able to run simple, quickly created, batch files via
> Puppet should be easy to do.   It's as much a matter of getting batch files
> to run as it is making this particular Disk Cleanup solution working.
>

Indeed it should be. Quick and dirty is one way to achieve what you want
with batch files, but given that your scripts are easily converted to
puppet manifests, you should definitely consider going that route. It
already automatically handles Windows File System / Registry Redirection,
which is likely what you are currently running into.

It's likely that you are using a 32 bit version of Puppet on a 64bit
version of Windows. When you call for c:\windows\cmd.exe and Windows File
System Redirector gets involved, Windows will automatically redirect you to
a 32bit cmd.exe in C:\Windows\SysWOW64\cmd.exe, which has only a 32 bit
view of the registry.

Let's take a look at one of your examples - REG ADD
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active
Setup Temp Folders" /v StateFlags0100 /d 2 /t REG_DWORD /f

Do me a favor and look at
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active
Setup Temp Folders" and tell me if you see what you are looking for there.


Once you've determined that is the issue, we can go into how to fix it.


>
> Any other ideas?
>
> Dimitri
>
> On Wednesday, July 29, 2015 at 3:48:50 PM UTC-4, Dimitri Yioulos wrote:
>>
>> Hello, all.
>>
>> I'm trying to execute the following batch file (sageset.bat) on Win2k8
>> servers:
>>
>> @ECHO OFF
>> REM Enable components to cleanup
>> REG ADD
>> "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active
>> Setup Temp Folders" /v StateFlags0100 /d 2 /t REG_DWORD /f
>> REG ADD
>> "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\BranchCache"
>> /v StateFlags0100 /d 2 /t REG_DWORD /f
>> REG ADD
>> "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Downloaded
>> Program Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
>> REG ADD
>> "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameNewsFiles"
>> /v StateFlags0100 /d 2 /t REG_DWORD /f
>> ~
>>
>> It makes changes to registry settings so that the disk cleanup utility
>> will do a more thorough job of cleanup.  It's the equivalent of running
>> "cleanmgr /d c: /sageset:100", which opens a dialog box that presents a
>> list of files to clean that one can check.
>>
>> The following is in my manifest:
>>
>> exec { 'sageset.bat':
>>          path => $::path,
>>          command => "cmd.exe /c c:\temp\sageset.bat",
>>          provider => windows,
>>          logoutput => true,
>>         }
>>
>> The results of the manifest run are that everything executed
>> successfully.  However, if I run "cleanmgr /d c: /sageset:100" after that,
>> none of the boxes is checked.  Running the batch file in a Windows CLI does
>> work, and if I run "cleanmgr /d c: /sageset:100" after that, all of the
>> boxes are checked.
>>
>> Why am I not getting this to work?
>>
>> Dimitri
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/ff647484-10b7-400f-8778-b747a9adbbb6%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/ff647484-10b7-400f-8778-b747a9adbbb6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Rob Reynolds
Developer, Puppet Labs

*PuppetConf 2015 <http://2015.puppetconf.com/> is coming to Portland,
Oregon! Join us October 5-9.*
*Register now to take advantage of the Early Bird discount
<https://www.eventbrite.com/e/puppetconf-2015-october-5-9-tickets-13115894995?discount=EarlyBird>
*
*—**save $249!*

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAMJiBK77sN9bd%3DyJDD%3DmrmroowMc25EpFiSjoiJAwGa%2BONaGeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to