Pregunta

Base: I have a short piece of a registry changing vb script.

key = "Software\Microsoft\Windows\CurrentVersion\Explorer\Streams"
result = wmireg.CreateKey(HKCU, key)

binaer = Array(8,0,0,0,6,0,0,0,0,0,0,0,229,37,241,101,225,123,16,72,186,157,210,113,200,67,44,227,4,0,0,0,3,0,0,0,67,0,0,0)

result = wmireg.SetBinaryValue(HKCU, key,"Settings",binaer)

key ="Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults"
result = wmireg.CreateKey(HKCU, key)
binaer = Array(28,0,0,0,5,0,0,0,0,0,3,0,0,0,144,0,0,0,0,0,1,0,0,0,255,255,255,255,240,240,240,240,20,0,3,0,144,0,0,0,0,0,0,0,48,0,0,0,253,223,223,253,15,0,4,0,32,0,16,0,40,0,60,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,42,1,96,0,120,0,120,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
result = wmireg.SetBinaryValue(HKCU,key,"{F3364BA0-65B9-11CE-A9BA-00AA004AE837}", binaer)

Problem: In this snippet the default view of the explorer will be set to tile-view. Everything works fine in Windows XP. Now I am going to translate this to Windows 8, but with no success.

I used the Process Monitor to figure out the registry key values which will be set if I do this step manually using the UI.

In Windows 8, the key:

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Settings

Will be set to:

08 00 00 00 06 00 00 00 01 00 00 00 E5 25 F1 65

And the key:

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults\{5C4F28B5-F869-4E84-8E60-F11DB97C5CC7}

Will be set to

1C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

In Windows XP I can change this values by the script, restart (or logout-login) and the default view is the tiles view. But in Windows 8 nothing happens.

I changed the vbs with the Windows 8 values, now if the script is complete the value in the registry will be successfully modified. But if I open my explorer there is no other view applied.

¿Fue útil?

Solución

After some research with RegShot I figured out that you have to delete these keys first:

  1. Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags
  2. Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU

Windows does not need these keys to be consistent. If they are missing the system creates them on the fly with basic settings.

After removing these keys you can set your default view by setting the right bytes to these keys:

  1. Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Settings
  2. Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults\{5C4F28B5-F869-4E84-8E60-F11DB97C5CC7}

With the RegShot tool you can find out the right bytes for Symbole-, Details- or List-View. If anyone needs them leave a comment. I do not want to write a ~40x20 Byte-Matrix to this post ;).

With this method you do not need a restart or a logoff to change your default folder view for all folders. This method does also reset all saved folder-views and set the default one.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top