Installdate aus Registry als Label
-
stambo -
30. Dezember 2015 um 11:26 -
Erledigt
-
-
- Offizieller Beitrag
Poste bitte mal ein lauffähiges Beispielscript, dann muss nicht jeder ein Script dazu schreiben.
-
C
Alles anzeigen#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Date.au3> $Form1 = GUICreate("test", 500, 350, -1, -1) $Label2_instdate = GUICtrlCreateLabel((_DateAdd("s",RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "InstallDate"),"1970/01/01 00:00:00")), 180, 220, 180, 17) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
-
- Offizieller Beitrag
Welches BS benutzt du? Bei Win10/64 Pro läuft es einwandfrei.
Btw, das zurückgegeben Datum stimmt, aber die Zeitzone wird nicht beachtet.
Nach unserer Zeitzone muss man noch 2 Stunden hinzuziehen. -
Habe es mit Win7 32/64, Win10/64, und WinServer2008R2 getestet,
trotzdem wird mir immer "1970/01/01 00:00:00" angezeigt und nicht das eigentliche Installationsdatum des OS. -
- Offizieller Beitrag
Probier es mal mit #RequireAdmin am Scriptanfang.
Habe das Script jetzt auf 6 Rechnern/VMs getestet, dort wird immer die richtige Zeit/Datum ausgegeben. -
Supi, jetzt hab ich es hinbekommen.
-
- Offizieller Beitrag
Und wie? mit #RequireAdmin?
-
Supi, jetzt hab ich es hinbekommen.
hmm....ich habe bei mir nachgesehen und da steht im DWORD: 53a81a0b (oder Dezimal 1403525643)....
Und eigentlich sollten keine Adminrechte notwendig sein, denn der Benutzer darf dort lesen....
lg
Racer -
AutoIt
Alles anzeigen;-- TIME_STAMP 2016-01-02 16:42:19 #Region ;************ Includes ************ #Include <AutoItConstants.au3> #include <GUIConstantsEx.au3> #EndRegion ;************ Includes ************ $Form1 = GUICreate("test", 500, 350, -1, -1) ; This key can be empty... so it is an insecure source to get information. ; $Label2_instdate = GUICtrlCreateLabel((_DateAdd("s", RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "InstallDate"), "1970/01/01 00:00:00")), 180, 220, 180, 17) ; Hereby it works safer... Local $iPID = Run("powershell.exe" & " ([WMI]'').ConvertToDateTime((Get-WmiObject Win32_OperatingSystem).InstallDate)", "", @SW_HIDE, $STDOUT_CHILD) ; Wait until the process has closed using the PID returned by Run. ProcessWaitClose($iPID) ; Read the Stdout stream of the PID returned by Run. Local $sOutput = StdoutRead($iPID) Local $Label2_instdate = GUICtrlCreateLabel($sOutput, 180, 220, 180, 26) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
-
Ich habe mal eine Frage: wozu ist dieses Datum notwenig und was ist, wenn man es einfach ändert?
-
Das Installationsdatum hat lediglich informativen Charakter und kann bei Bedarf beliebig geändert werden.
Siehe hier: http://www.windows7-tuning.de/tuning-tipps-a…anzeigenandern/