In some configurations, this will happen. For example, if I am on a regular user account and run something as admin, it will try looking in the administrators profile area for the files. I have got around that problem by adding Code: %~DP0 to the beguining of a batch file to get it to start running from inside the folder it was called from.
Also inform him that you only need to run the TakeControlOf.cmd as an administrator. The AdRemover.bat needs to be run normally, not as an administrator. I'll try to add something to the batch so that it doesn't matter if you run AdRemover as an admin or not. (thanks Humphrey if it works ) Humphrey: Googled that command. Apparently it's %~dp0. I can't seem to get it to work on my batch though. According to most sources, I would put it in front of the file that I want to take from the current directory of the batch. For example: Code: do (copy Generic.xaml "%%a") Would become Code: do (copy %~dp0Generic.xaml "%%a") Yet it doesn't do anything but break the code. I'm unfamiliar with that command, so if you could shed some light on it or maybe give me an example, that would help. As for now, I'm simply cautioning people to NOT run the AdRemover.bat as an administrator.
I've updated the app to support ad removal in Sky News. Also, I didn't see any ads in gmail calendar or Accuweather after running the new v0.8 script. Try it out!
Can't get this to work anymore, even with the new 0.8 script. Yes I run the take control as admin, and the remove adds normal. Any thoughts on this?
Windows 8 Pro I have tried running it as admin, even went as far as opening an admin command prompt, add copying what was inside the takecontolof, and that didn't work either.
Code: @echo off CD %~DP0 for /f "delims=" %%a in ('dir "%programfiles%\WindowsApps" /ad /b /s ^| find /i "AdDuplex.Windows\Themes"') do (copy Generic.xaml "%%a") for /f "delims=" %%a in ('dir "%programfiles%\WindowsApps" /ad /b /s ^| find /i "Microsoft.Advertising.WinRT.UI\Themes"') do (copy Generic.xaml "%%a") for /f "delims=" %%a in ('dir "%programfiles%\WindowsApps" /ad /b /s ^| find /i "Microsoft.PlayerFramework.Advertising\Themes"') do (copy Generic.xaml "%%a") for /f "delims=" %%a in ('dir "%programfiles%\WindowsApps" /ad /b /s ^| find /i "Content\Ad\Images"') do (rmdir /s /q "%%a") for /f "delims=" %%a in ('dir "%programfiles%\WindowsApps" /ad /b /s ^| find /i "Images\Ad"') do (rmdir /s /q "%%a") for /f "delims=" %%a in ('dir "%programfiles%\WindowsApps" /ad /b /s ^| find /i "Common\AdsModule\View"') do (copy VideoRollAd.xaml "%%a") for /f "delims=" %%a in ('dir "%programfiles%\WindowsApps" /ad /b /s ^| find /i "Common\AdsModule\View"') do (copy MainPageAd.xaml "%%a") for /f "delims=" %%a in ('dir "%programfiles%\WindowsApps" /ad /b /s ^| find /i "Controls\Ad"') do (copy OasAdControl.xaml "%%a") for /f "delims=" %%a in ('dir "%programfiles%\WindowsApps" /ad /b /s ^| find /i "msacl.ui\Controls\Banners"') do (copy AdControl.xaml "%%a") for /f "delims=" %%a in ('dir "%programfiles%\WindowsApps" /ad /b /s ^| find /i "BritishSkyBroadcasting.SkyNews_2.0.0.0_neutral__0b9xnhb6xcwd0\Views"') do (copy GroupedItemsPage.xaml "%%a") setlocal set cwd=%CD% set p=MSAdvertisingJS\ads cd /d "%programfiles%\WindowsApps" for /d %%I in (*) do ( if exist "%%I\%p%\" ( pushd "%%I\%p%\" del /q bootstrap.html popd ) ) :: (change back to original directory) cd /d "%cwd%" This %~DP0 is put at the top of the file with CD so that the working directory the command prompt has is the directory it is being ran from. You can also put the in front of the the files you are working with but I have not done this. For those that want to restore the ownership information: Code: icacls "%programfiles%\WindowsApps" /setowner "NT Service\TrustedInstaller" /T /C
Excellent! I'll wait to update the script until I add some more ad removals. I do appreciate it though. @Ron1958: What does it say when you try running it as an admin? Are you SURE you're not running 8.1? I know you replied earlier in the thread saying that it doesn't work on 8.1.
Can you open up an admin command prompt, drag and drop the TakeControlOf.cmd file into it and screenshot the output for me?
Make sure you change the ownership restore command from: This Code: icacls "%windir%\winsxs\Catalogs" /setowner "NT Service\TrustedInstaller" /T /C to this: Code: icacls "%programfiles%\WindowsApps" /setowner "NT Service\TrustedInstaller" /T /C Also, @Ron1958, open a command prompt and type: Code: wmic os get version and post back the info you get. @1337chaos: You should put in a version check that uses the bit of code i told ron1958 to run. When it is ran, you either get back 6.2.9200 if on Windows 8 or 6.3.#### if on Windows 8.1.
Easiest way would be: Code: REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion | FINDSTR 6.2 >NUL IF %ERRORLEVEL% NEQ 0 ( echo Feature is only supported on Windows 8^! pause goto :Exit )
In none of these replies do I see the actual problem. Explain, in detail, what part isn't working. Which batch file is causing the issue?
Or Code: ver | FINDSTR 6.2 >NUL IF %ERRORLEVEL% NEQ 0 ( echo Feature is only supported on Windows 8^! pause goto :Exit )
When you run the batch files. You run, take own first and adremove last as you've said. Does take own show any errors, what about adremove?
Goto folder options, the view tab, then change hidden files and folders to show. Right click on adremove.bat and change @ECHO OFF to @ECHO ON Run takeown again as admin and normally run adremove.bat again. look for file not found or errors. Change youe takeown.bat to this Code: CD /D %~DP0 takeown /f "C:\Program Files\WindowsApps" /r /d y >output.log icacls "C:\Program Files\WindowsApps" /grant administrators:F /t >output.log upload output.log for us or just tell us what the bottom line says.
I hope this is what You want, I zipped the log file up, but the site says it's to large to upload. Successfully processed 35745 files; Failed processing 0 files Here is one of the adds I see.