well, there is a way, but it's still need a little software, search for SetACL from helgeklein.com run a CMD with admin, and let's say you want to take ownership to a reg map just run the code for example Grant permissions The command will now complete successfully:
I found that tool but what i wanted to my script is to be one BAT script file i also find a tutorial that talks about REGINI.exe (built in Windows) but i couldn't find the way to make it work i will be glad if someone can help me with this there is more other tweaks that i can add like : Change Network Control UI (in system Tray)
I think if you want to take ownership of registry keys, and change permissions, you would need to create a compressed file with the SetACL command in it, that extracted it to a specific place where your bat file could access it. Such as \Windows\System32. I have used that SetACL file, and it works beautifully.
Thanks men But what i want is a way to take ownership of registry keys with BAT or VBS or other scripts like PS1 and if it's not BAT and it is VBS or .. is must not contain this character "&" because i want my tool to be one file and if i find a VBS script i will write it via BAT and execute it as VBS like the MsgBox example but if it contains this character "&" i just won't work
Yea, it's tough. I searched long and hard to find a script to change permissions. But it is different for you because you want to share something simple. I just don't know how to do that.
Well, that sucks. I download the batch file using Chrome and so it downloaded to my "Downloads" folder. Now, for insight, I have directed Downloads to D:\Downloads (more space, whatever) Ran it and the following two lines basically deleted everything in my "Downloads" folder: 746: cd %Windir%\SoftwareDistribution\ 747: 748: del * /S /Q So, line 746 switches the current directory on C:, but I'm running on D:, and so BOOM! There goes my D:\Downloads.
Thanks jhanford, your unfortunate accident save me do wipe my D:\Downloads folder. line 746 should be Code: cd /D %Windir%\SoftwareDistribution\ /D tell cd to change to drive in addition to change to folder I prefer to use PUSHD/POPD in scripts, seems more safer than CD, especially when you are changing directories to delete stuff. Code: PUSHD %Windir%\SoftwareDistribution\ DEL /S /Q "%Windir%\SoftwareDistribution\*.*" POPD If you want do delete all empty folders inside %Windir%\SoftwareDistribution\, use this Code: PUSHD %Windir%\SoftwareDistribution\ FOR /f "delims=" %%d in ('dir /s /b /ad %1 ^| sort /r') do rd "%%d" 2>nul POPD People complain about it being a script that you can read and understand what it is doing instead a cryptic executable that God knows what it's doing. Imagine if it's a executable, how long until someone figure what's wrong?
line 764 direct you to this path in system drive X:\Windows\SoftwareDistribution and then delete everything in it I really don't why that happened to you
Thanks men for the code i added it and i added an IF statement to Make sure that it will work (it will) Code: :startclean net stop wuauserv PUSHD %Windir%\SoftwareDistribution\ if not '%cd%'=='%Windir%\SoftwareDistribution' ( goto startclean ) DEL /S /Q "%Windir%\SoftwareDistribution\*.*" rmdir /S /Q "%SYSTEMDRIVE%\MSOCache\" POPD Dism.exe /online /Cleanup-Image /StartComponentCleanup net start wuauserv
Do you think it's good to add this to script !! Enable/Disable telemetry and data collecting Enable/Disable Windows Update sharing
Hi, Windows 10 have a lot of unneeded Services, you can add a section to disable services that most user don't need.