I run the script twice and it got stuck both times in "applying",
the first time it created the file, on the second no,
Code:Checking whether the script is being executed with administrator privileges... Administrator privileges found! Checking automatic 'hosts' backup routine... Automatic 'hosts' backup is enabled! Original 'hosts'-file already found! Creating backup of current 'hosts'-file... Saved current 'hosts'-file: C:\Windows\system32\drivers\etc\hosts.old Checking automatic 'hosts' apply routine... Automatic 'hosts' apply is enabled! Applying new 'hosts'-file...
edit: my bad, I was testing hozz at the same time and I think it was blocking your script
edit2: still doesn't finish, powershell reaches around 800mb in memory,
the hosts file (5mb) is created, but powershell is stuck there
edit3: ok, I'll be running the user script and I'll be doing the "distribution" myself
Code:Finished the PowerShell AdBlock script! Elapsed time: 329.9136152 seconds Press any key to continue . . .
I experienced a similar behavior when I started to use the script, and it was because a process was using the hosts file and _somehow_ the whole process went into a deadlock condition. IIRC it was an Skype associated process (on Windows 10).
But, despite that it seems that you've probably solved the issue (or done a workaround) have you reviewed the log file to see if there was any additional information about what went wrong? That could help to improve the script.
Last edited: