Wrong syntax for Takeown in Script DISABLE MICROSOFT DIAGNOSTICS TRACKING PLUGIN
I ran Ancile 1.8 on my german Version of Windows 7 and got this issues:
1) The log wrote: [...] BEGIN DISABLE MICROSOFT DIAGNOSTICS TRACKING PLUGIN Disabling diagnostic tracking service Disabling dmwap push service service Disabling diagnostic data collection registry entries Der Vorgang wurde erfolgreich beendet.
Deleting Diagnostic Log files Fehler: Ungltige Syntax. Der Wert 'y' kann fr die Option '/D' nicht verwendet werden. Geben Sie "TAKEOWN /?" ein, um die Syntax anzuzeigen. [...]
Which means in english: Error: Wrong syntax. The Value 'y' is not valid for the option '/D'. Please type "TALEOWN /?" to get informations about the syntax.
So, the following command in script 'disable_MSTD.cmd' will fail: takeown /F %PROGRAMDATA%\Microsoft\Diagnosis /A /R /D y >> "%LOGFILE%" 2>&1
2) The same issue occours at section: BEGIN DISABLE WINDOWS 10 FORCED UPGRADE The log wrote: [...] Error: Wrong syntax. The Value 'y' is not valid for the option '/D'. Please type "TALEOWN /?" to get informations about the syntax. [...]
So, the following command in script 'disable_WINXupdate.cmd' will fail: takeown /F "%WINXDIR%" /A /R /D y >> "%LOGFILE%" 2>&1
3) The log wrote: [...] BEGIN FIREWALL MODIFICATION Generating firewall ruleset
C:\Users\XXXXXXX\Desktop\System und Sicherheit\Ancile_1.8\data\modify_WINFirewall\modify_winfirewall.lst
Deleting old firewall ruleset Deleting old firewall ruleset
Nicht behebbarer Fehler in der Windows-Firewall (0x2). [...]
Which means in english: Unresolveable error in Windows-Firewall (0x2).
4) If I have a look into the Windows hosts file after running Ancile, I see no modifications in the hosts file. It is untouched and clean like after a new Windows 7 install.
The hostfile location is: c:\Windows\System32\drivers\etc\
Maybe you can reproduce and fix this issues? Thank you very much in advance for your support.
Greetings from Germany, Markus
Comments (8)
-
-
Hi Matthew,
thank you for your support.
Point 1 & 2) I executed your script. The resulting logfile is unfortunately in german language. If you have problems with translation, please let me know which parts are interesting for you. I'll then try to translate.
Info: I made some data in the logfile unrecognizable, because I have classified them as sensitive.
BENUTZERINFORMATIONEN --------------------- Benutzername SID ============ ============================================= n1\user XXXX Hidden by the user XXXX GRUPPENINFORMATIONEN -------------------- Gruppenname Typ SID Attribute ==================================================================== =============== ============ ================================================================================ Jeder Bekannte Gruppe S-1-1-0 Verbindliche Gruppe, Standardmäßig aktiviert, Aktivierte Gruppe NT-AUTORITÄT\Lokales Konto und Mitglied der Gruppe "Administratoren" Bekannte Gruppe S-1-5-114 Verbindliche Gruppe, Standardmäßig aktiviert, Aktivierte Gruppe VORDEFINIERT\Administratoren Alias S-1-5-32-544 Verbindliche Gruppe, Standardmäßig aktiviert, Aktivierte Gruppe, Gruppenbesitzer VORDEFINIERT\Benutzer Alias S-1-5-32-545 Verbindliche Gruppe, Standardmäßig aktiviert, Aktivierte Gruppe NT-AUTORITÄT\INTERAKTIV Bekannte Gruppe S-1-5-4 Verbindliche Gruppe, Standardmäßig aktiviert, Aktivierte Gruppe KONSOLENANMELDUNG Bekannte Gruppe S-1-2-1 Verbindliche Gruppe, Standardmäßig aktiviert, Aktivierte Gruppe NT-AUTORITÄT\Authentifizierte Benutzer Bekannte Gruppe S-1-5-11 Verbindliche Gruppe, Standardmäßig aktiviert, Aktivierte Gruppe NT-AUTORITÄT\Diese Organisation Bekannte Gruppe S-1-5-15 Verbindliche Gruppe, Standardmäßig aktiviert, Aktivierte Gruppe NT-AUTORITÄT\Lokales Konto Bekannte Gruppe S-1-5-113 Verbindliche Gruppe, Standardmäßig aktiviert, Aktivierte Gruppe LOKAL Bekannte Gruppe S-1-2-0 Verbindliche Gruppe, Standardmäßig aktiviert, Aktivierte Gruppe NT-AUTORITÄT\NTLM-Authentifizierung Bekannte Gruppe S-1-5-64-10 Verbindliche Gruppe, Standardmäßig aktiviert, Aktivierte Gruppe Verbindliche Beschriftung\Hohe Verbindlichkeitsstufe Bezeichnung S-1-16-12288 Verbindliche Gruppe, Standardmäßig aktiviert, Aktivierte Gruppe BERECHTIGUNGSINFORMATIONEN -------------------------- Berechtigungsname Beschreibung Status =============================== ======================================================== =========== SeIncreaseQuotaPrivilege Anpassen von Speicherkontingenten für einen Prozess Deaktiviert SeSecurityPrivilege Verwalten von Überwachungs- und Sicherheitsprotokollen Deaktiviert SeTakeOwnershipPrivilege Übernehmen des Besitzes von Dateien und Objekten Deaktiviert SeLoadDriverPrivilege Laden und Entfernen von Gerätetreibern Deaktiviert SeSystemProfilePrivilege Erstellen eines Profils der Systemleistung Deaktiviert SeSystemtimePrivilege Ändern der Systemzeit Deaktiviert SeProfileSingleProcessPrivilege Erstellen eines Profils für einen Einzelprozess Deaktiviert SeIncreaseBasePriorityPrivilege Anheben der Zeitplanungspriorität Deaktiviert SeCreatePagefilePrivilege Erstellen einer Auslagerungsdatei Deaktiviert SeBackupPrivilege Sichern von Dateien und Verzeichnissen Deaktiviert SeRestorePrivilege Wiederherstellen von Dateien und Verzeichnissen Deaktiviert SeShutdownPrivilege Herunterfahren des Systems Deaktiviert SeDebugPrivilege Debuggen von Programmen Deaktiviert SeSystemEnvironmentPrivilege Verändern der Firmwareumgebungsvariablen Deaktiviert SeChangeNotifyPrivilege Auslassen der durchsuchenden Überprüfung Aktiviert SeRemoteShutdownPrivilege Erzwingen des Herunterfahrens von einem Remotesystem aus Deaktiviert SeUndockPrivilege Entfernen des Computers von der Dockingstation Deaktiviert SeManageVolumePrivilege Durchführen von Volumewartungsaufgaben Deaktiviert SeImpersonatePrivilege Annehmen der Clientidentität nach Authentifizierung Aktiviert SeCreateGlobalPrivilege Erstellen globaler Objekte Aktiviert SeIncreaseWorkingSetPrivilege Arbeitssatz eines Prozesses vergrößern Deaktiviert SeTimeZonePrivilege Ändern der Zeitzone Deaktiviert SeCreateSymbolicLinkPrivilege Erstellen symbolischer Verknüpfungen Deaktiviert Hostname: N1 Betriebssystemname: Microsoft Windows 7 Professional Betriebssystemversion: 6.1.7601 Service Pack 1 Build 7601 Betriebssystemhersteller: Microsoft Corporation Betriebssystemkonfiguration: Eigenständige Arbeitsstation Betriebssystem-Buildtyp: Multiprocessor Free Registrierter Benutzer: User Registrierte Organisation: Produkt-ID: XXXX Hidden by the user XXXX Ursprüngliches Installationsdatum: 11.12.2016, 21:01:29 Systemstartzeit: 10.01.2017, 21:12:51 Systemhersteller: HP Systemmodell: HP 250 G5 Notebook PC Systemtyp: x64-based PC Prozessor(en): 1 Prozessor(en) installiert. [01]: Intel64 Family 6 Model 78 Stepping 3 GenuineIntel ~1275 MHz BIOS-Version: Insyde F.13, 21.07.2016 Windows-Verzeichnis: C:\Windows System-Verzeichnis: C:\Windows\system32 Startgerät: \Device\HarddiskVolume1 Systemgebietsschema: de;Deutsch (Deutschland) Eingabegebietsschema: de;Deutsch (Deutschland) Zeitzone: (UTC+01:00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien Gesamter physikalischer Speicher: 8.083 MB Verfügbarer physikalischer Speicher: 6.499 MB Virtueller Arbeitsspeicher: Maximale Größe: 8.081 MB Virtueller Arbeitsspeicher: Verfügbar: 6.458 MB Virtueller Arbeitsspeicher: Zurzeit verwendet: 1.623 MB Auslagerungsdateipfad(e): Nicht zutreffend Domäne: HOME Anmeldeserver: \\N1 Hotfix(es): Nicht zutreffend Netzwerkkarte(n): 4 Netzwerkadapter installiert. [01]: Realtek PCIe GBE Family Controller Verbindungsname: LAN-Verbindung Status: Medien getrennt [02]: Intel(R) Dual Band Wireless-AC 3165 Verbindungsname: Drahtlosnetzwerkverbindung DHCP aktiviert: Ja DHCP-Server: XXXX Hidden by the user XXXX IP-Adresse(n) [01]: XXXX Hidden by the user XXXX [02]: XXXX Hidden by the user XXXX [03]: XXXX Hidden by the user XXXX [04]: XXXX Hidden by the user XXXX [03]: Microsoft Virtual WiFi Miniport Adapter Verbindungsname: Drahtlosnetzwerkverbindung 2 Status: Medien getrennt [04]: Bluetooth-Gerät (PAN) Verbindungsname: Bluetooth-Netzwerkverbindung Status: Medien getrennt ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\User\AppData\Roaming CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=N1 ComSpec=C:\Windows\system32\cmd.exe FP_NO_HOST_CHECK=NO HOMEDRIVE=C: HOMEPATH=\Users\User LOCALAPPDATA=C:\Users\User\AppData\Local LOGONSERVER=\\N1 NUMBER_OF_PROCESSORS=4 OS=Windows_NT Path=C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 78 Stepping 3, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=4e03 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PROMPT=$P$G PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ PUBLIC=C:\Users\Public SystemDrive=C: SystemRoot=C:\Windows TEMP=T:\Temp TMP=T:\Temp USERDOMAIN=N1 USERNAME=User USERPROFILE=C:\Users\User windir=C:\Windows windows_tracing_flags=3 windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log SERVICE_NAME: MpsSvc TYPE : 20 WIN32_SHARE_PROCESS STATE : 4 RUNNING (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0
Point 3) The Windows firewall is active. I have just installed Windows 7 Professional and have not installed any application software afterwards. The system has only been "optimized" to a minimal setup. What does this mean? -> Maybe you know the TV series "Monk"? I'm a bit strange in relation to my computer system. Therefore I have cleaned the system after first install, so that it provides only functions and applications I really need. Specifically, this means that I have disabled some system services that are not necessary for me. Maybe the problems are related to this action? I'll attach a list of services I have changed.
Apart from that, the IPs to be blocked were -despite the error- added to the firewall. I see the IP list in the firewall under "Outgoing rules" / Ancile - Block Malicious IP Addresses". I do not know whether the error message in the script is simply an optical problem.
Sorry this system services list is also in german language, because my Windows is in german. :-/
Name State old State new ------------------------------------------------------------------------------------------------ - Anmeldeinformationsverwaltung manuell deaktiviert - Anschlussumleitung für Terminaldienst im Benutzermodus manuell deaktiviert - BitLocker-Laufwerksverschlüsselungsdienst manuell deaktiviert - Bluetooth Device Monitor automatisch (verzögert) manuell - Bluetooth Media Service automatisch (verzögert) manuell - Bluetooth OBEX Service automatisch (verzögert) manuell - BranchCache manuell deaktiviert - COM+-Ereignissystem automatisch manuell - Defragmentierung manuell deaktiviert - Diagnoserichtliniendienst automatisch deaktiviert - Diagnosesystemhost manuell deaktiviert - Diagnostic Tracking Service deaktiviert (Spy) - Distributed Transaction Coordinator manuell deaktiviert - DNS-Client automatisch deaktiviert - Fax manuell deaktiviert - Funktionssuche - Ressourcenveröffentlichung manuell deaktiviert - Heimnetzgruppen-Anbieter manuell deaktiviert - Heimnetzgruppen-Listener manuell deaktiviert - Internet Explorer ETW Collector Service manuell deaktiviert - IP-Hilfsdienst automatisch deaktiviert - Konfiguration für Remotedesktops manuell deaktiviert - KtmRm für Distributed Transaction Coordinator manuell deaktiviert - Leistungsprotokolle und -Warnungen manuell deaktiviert - Microsoft iSCSI-Initiator-Dienst manuell deaktiviert - Microsoft-Softwareschattenkopie-Anbieter manuell deaktiviert - NAP-Agent (Network Access Protection) manuell deaktiviert - Offlinedateien automatisch deaktiviert - Parental Controls manuell deaktiviert - PnP-X-IP-Busauflistung manuell deaktiviert - PNRP-Computernamenveröffentlichungs-Dienst manuell deaktiviert - Programmkompatibilitäts-Assistent-Dienst automatisch deaktiviert - Realtek Audio Service automatisch manuell - Remotedesktop-Dienste manuell deaktiviert - Richtlinie zum Entfernen der Smartcard manuell deaktiviert - Shellhardwareerkennung automatisch deaktiviert - Sicherheitscenter automatisch (verzögert) manuell - Sitzungs-Manager für Desktopfenster-Manager automatisch deaktiviert - Smartcard manuell deaktiviert - SNMP-Trap manuell deaktiviert - Superfetch manuell deaktiviert - Tablet PC-Eingabedienst manuell deaktiviert - TCP/IP-NetBIOS-Hilfsdienst automatisch manuell - Telefonie manuell deaktiviert - Überwachung verteilter Verknüpfungen (Client) automatisch deaktiviert - Unterstützung in der Systemsteuerung unter Lösungen für Prob. manuell deaktiviert - Verbessertes Windows-Audio/Video-Streaming manuell deaktiviert - Verbindungsschicht-Topologieerkennungs-Zuordnungsprogramm manuell deaktiviert - Verwaltung für automatische RAS-Verbindung manuell deaktiviert - Volumeschattenkopie manuell deaktiviert - Windows CardSpace manuell deaktiviert - Windows Media Center-Empfängerdienst manuell deaktiviert - Windows Media Center-Planerdienst manuell deaktiviert - Windows Media Player-Netzwerkfreigabedienst automatisch (verzögert) deaktiviert - Windows-Search automatisch deaktiviert - Windows-Biometriedienst manuell deaktiviert - Windows-Ereignissammlung manuell deaktiviert - Windows-Fehlerberichterstattungsdienst manuell deaktiviert - Windows-Remoteverwaltung (WS-Verwaltung) manuell deaktiviert - Windows-Sicherung manuell deaktiviert - WMI-Leistungsadapter manuell deaktiviert - WWAN - automatische Konfiguration manuell deaktiviert - Zertifikatverteilung manuell deaktiviert
Point 4) I believe that I found the cause. While running your script, another (virtual) host file was active. Beside Ancile I had running a programm which logs all the changes made by Ancile by comparing two system- and registry snapshots. (sorry, my Monk syndrome ;-)).
However, I now tried to run Ancile 1.8 again (without the snapshot software), but the script is no longer executed and no new log file is generated. I execute Ancile by right-clicking on the .cmd file and "Run as Administrator". Then the DOS window opens for a short moment and is immediately closed again. No logfile is created in the directory where Ancile is located. Is this a desired behavior, that the script can be executed only once?
Matthew, I say thank you very much for your support and also thanks that you have taken the fight against Micrsofts Spy updates. Without Ancile (and without DoNotSpy78) I would not have performed the switching from Windows XP to Windows 7 (monk monk monk ... ;-) )
Markus
-
PS: I disabled the unneeded system services as recently as after running Ancile. Ancile was executed directly after I installed Windows 7 in December 2016. The services were disabled in January 2017. Maybe the script does not start because I disabled some needed system services?
Edit: I found the reason for 4)! The Ancile script cannot handle directories with an "commercial and sign" in the name. I executed Ancile in a directory named "System & Sicherheit" and the script tried to access the ini file using this partially path "system config.ini". so the path name is cuttet off after (and including) the "&" sign. In December 2016 I executed Ancile out of another directory without "&" and without spaces in the path name.
4) is solved now. I executed Anclie now from another directory and the hosts file was modified as expected.
3) seems solved too. Maybe the "problem" was that there was no previous Ancile rule in the firewall that could be deleted at the first run? The log of my second run looks okay:
[10.01.2017 23:23:59,64] BEGIN FIREWALL MODIFICATION Generating firewall ruleset C:\Users\User\Desktop\Ancile_1.8\data\modify_WINFirewall\modify_winfirewall.lst Deleting old firewall ruleset Deleting old firewall ruleset 1 Regel(n) wurde(n) gel”scht. OK. Adding new firewall ruleset Adding updated firewall ruleset OK. [10.01.2017 23:23:59,82] END FIREWALL MODIFICATION
So it seems It remains only the problem with the Takown syntax. :-)
Oh wait, no there is another error during restarting the windows time service:
[10.01.2017 23:23:43,11] BEGIN NTP SYNC Der Vorgang wurde erfolgreich beendet. Der Befehl wurde erfolgreich ausgeführt. Der Vorgang wurde erfolgreich beendet. Der Vorgang wurde erfolgreich beendet. Der Vorgang wurde erfolgreich beendet. Der Vorgang wurde erfolgreich beendet. Der Vorgang wurde erfolgreich beendet. Der Vorgang wurde erfolgreich beendet. [SC] ChangeServiceConfig ERFOLG Windows-Zeitgeber wird gestartet. **(Translation: Starting Windows timer)** Windows-Zeitgeber konnte nicht gestartet werden. **(Translation: Could not start Windows timer)** Ein Systemfehler ist aufgetreten. **(Translation: A system error has occurred.)** Systemfehler 2 aufgetreten. **(Translation: System error 2 occurred.)** Das System kann die angegebene Datei nicht finden. **(Translation: The system can not find the specified file.)** Folgender Fehler ist aufgetreten: Der Dienst wurde nicht gestartet. (0x80070426) **(Translation: The following error occurred: The service was not started. (0x80070426))** Folgender Fehler ist aufgetreten: Der Dienst wurde nicht gestartet. (0x80070426) **(Translation: The following error occurred: The service was not started. (0x80070426))** [10.01.2017 23:23:45,21] END NTP SYNC
-
Great work debugging. I'll see if I can find a fix for special characters like "&" in directories.
It looks like the firewall code is working as expected now. I really should check to se if a rule exists before just deleting it. I'll make a note to fix that.
I'm still looking into the "takeown" issue. There doesn't seem to be any documentation that mentions not handling "/D y", but that's not surprising. I may be able to just remove that option. I'll let you know when I get time to test that.
The Windows time service restart problem is a known issue and the fix will be included in the next version.
Thanks for your help.
-
Your'e welcome, Matthew.
I have to say thank you, because with Ancile you make Windows 7 available to a paranoid security fanatic.
To give you an impression: I have been busy since 26 december 2016 every free hour to set up this new notebook with Windows 7 according to my wishes and my security needs. This weekend I was completely busy finding a new antivirus software. On my old XP computer Free Antivir by Avira is installed, but this software is too much bloated and resource-hungry these days. Well, it's not always easy to be punished with a "Monk" syndrome. ;-)
-
Any updates for this issue under version 1.10?
I've added "/D y" back onto the "takeown" command so that issue might be back.
-
The "/d" option value of the "takeown" command varies according to the language of Windows. You can check the language and adapt the variable with the correct parameter for "/d" or you can use the "chcp" command and set code page 437. The second solution is the best because you don't have to change variable or adapt the code for all languages.
-
Hey mark hellon,
Thanks for looking into that for me. It's been on my list of things to address for a while now.
I haven't had a lot of time to work on Ancile lately, but If I do find the time to put out another release I'll be sure to try and include this. If I'm lucky I might be able to fix a number of issues caused by varying behavior under different languages.
- Log in to comment
1 & 2) it looks like your "takeown" command doesn't support the documented options. This is very strange behavior. From an administrative command prompt run the following commands:
Post the contents of "systeminfo.log" here. This will help me to know a little bit more about the system you're running under.
3) This can happen when the Windows firewall is disabled, when you are running some types of anti-malware/antivirus programs that stop programs from modifying the firewall, or if you are running third party firewall software. Do you happen to know if this is the case?
4) Some anti-malware and Antivirus programs will prevent Ancile from adding entries to the hosts file. you may need to temporarily disable these.