0

http://www.tweakguides.com/VA_4.htmlで提供されているアドバイスに基づいて、WindowsVistaがWindowsエクスプローラーで列形式を「インテリジェントに」再配置しないようにするために、プロセスを少し自動化するスクリプトを作成しました。

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")


'Remove the "filthy" reg keys first.
regKey = "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU\"


WScript.Echo "Deleting " & regKey & VbCrLf
WshShell.RegDelete regKey

regKey = "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\"

WScript.Echo "Deleting " & regKey & VbCrLf
WshShell.RegDelete regKey


'Then recreate a clean Bags key, with sub-keys and FolderType value.
regKey = "HKCU\Software\Classes\Local Settings\Software\Microsoft\ Windows\Shell\Bags\AllFolders\Shell\FolderType"

WScript.Echo "Creating " & regKey & " as 'NotSpecified' REG_SZ " & VbCrLf
WshShell.RegWrite regKey, "NotSpecified", "REG_SZ"

WScript.Echo "Now define the columns of your preference in Windows Explorer," & VbCrLf
WScript.Echo "and click the Apply to Folders button in Folder Options." & VbCrLf

しかし、レジストリキーの削除を拒否しています

E:\archive\settings\Windows Vista Explorer columns.vbs(9, 1) WshShell.RegDelete:
 Unable to remove registry key "HKCU\Software\Classes\Local Settings\Software\Mi
crosoft\Windows\Shell\BagMRU\".

提案は、私が行ったキーを示すために末尾に「\」を付けることです。何か案は?

4

3 に答える 3

2

レジストリ設定にサブキーはありますか? キーを削除する前に、それらを削除する必要があると思います。

于 2009-09-16T19:23:58.163 に答える
1

Windows VistaでUACを無効にすると、このスクリプトは正常に機能します。

于 2009-02-19T14:41:47.837 に答える
1

それを壊してください:)

Const HKCR=&H80000000:Const HKCU=&H80000001:Const HKLM=&H80000002:Const HKU=&H80000003:Const HKCC=&H80000005

dim pc,o,hive,key,name,value,i
pc="."
Set o=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & pc & "\root\default:StdRegProv")

hive=HKCU
key="Software\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers\knownfolders\0\windows wallpapers\mergefolders"
regrid 5

sub regrid(levels)
dim a,n,j,base,s
    a=split(key,"\")
    n=ubound(a)
    base="":for i=0 to levels-1:base=base & a(i) & "\":next
    for i=n to levels step -1
        s="":for j=levels to i:s=s & a(j) & "\":next
        o.DeleteKey hive,base & s
    next
end sub

解放教育への皆様のご支援に感謝いたします

于 2012-03-10T09:05:33.223 に答える