
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
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("(https://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 & "
"
Else
WriteCode = sIn
End If
End Function
5/5 - (2 voti)