
VISUALIZZARE I PROGRAMMI IN ESECUZIONE AUTOMATICA
Con questo script (vbs) abbiamo la possibilità di monitorare i programmi e i servizi che si avviano automaticamente all’avvio del sistema (quando accendiamo il pc), in sostanza sostituisce in parte il comando msconfig direttamente da esegui per poi passare alla form di avvio.
Avviato lo script si aprirà il blocco note con la lista la quale si può chiudere senza avere l’opzione di salvataggio del documento.
Copia e incolla il codice e salva con nome con l’estensione .vbs
Codice:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
FileExt = "" : If FileExt = "" Then FileExt = "txt" OpenWith = "" : If OpenWith <> "" Then OpenWith = Trim(OpenWith) & " " With CreateObject("WScript.Network") ComputerName = .ComputerName UserName = .UserName End With Set fso = CreateObject("Scripting.FileSystemObject") Set ws = CreateObject("WScript.Shell") TmpFile = ws.ExpandEnvironmentStrings("%TEMP%") & "Startup." & Trim(FileExt) With fso.CreateTextFile(TmpFile, True) .WriteLine WriteCode("Lista dei programmi che si avviano in automatico per: " & ComputerName & _ ", Nome Account: " & UserName & ", " & Now()) .WriteLine WriteCode("") For Each o in GetObject _ ("winmgmts:\" & ComputerName & "rootcimv2").ExecQuery(_ "Select Name, Command, User, Location from Win32_StartupCommand",,48) If LCase(o.Command) <> "desktop.ini" _ AND LCase(o.User) <> ".default" _ AND InStr(LCase(o.User), "nt authority") = 0 Then .WriteLine WriteCode("Nome: " & o.Name) .WriteLine WriteCode("Comando: " & o.Command) .WriteLine WriteCode("User: " & o.User) .WriteLine WriteCode("Startup Location: " & o.Location) .WriteLine WriteCode("") Else s = s & vbcrlf & WriteCode("Nome: " & o.Name) s = s & vbcrlf & WriteCode("Comando: " & o.Command) s = s & vbcrlf & WriteCode("User: " & o.User) s = s & vbcrlf & WriteCode("Startup Location: " & o.Location) s = s & WriteCode("") & vbcrlf End If Next If s <> "" Then .WriteLine WriteCode(String(25, "*")) .WriteLine WriteCode("Servizi non compromettenti:") .WriteLine s .WriteLine WriteCode("") End If .WriteLine WriteCode("NOTE: Questa lista si cancellerà alla chiusura del file") .WriteLine WriteCode("") .WriteLine WriteCode("(http://www.giovannidimauro.it)") .Close End With On Error Resume Next ws.Run OpenWith & TmpFile,,True On Error GoTo 0 fso.GetFile(TmpFile).Delete Set fso = Nothing Set ws = Nothing Function WriteCode(sIn) If LCase(FileExt) = "htm" OR LCase(FileExt) = "html" Then WriteCode = sIn & "<br>" Else WriteCode = sIn End If End Function |