Ciao ragazzi

potreste aiutarmi a modificare questo script?


On Error Resume Next
strExplain="ClearRunMRU clears individual items from the Start - Run MRU (a list of recently run commands)." & vbCRLF & "The program will prompt for each item in the list." & vbCRLF & vbCRLF
strTitle="Clear Run MRU"

Dim Sh
Set Sh = WScript.CreateObject("WScript.Shell")
ReportErrors "Creating Shell"
Sh.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Ap p Paths\" & Wscript.ScriptName & "\", Chr(34) & Wscript.ScriptFullName & Chr(34)
Sh.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Ap p Paths\" & Left(Wscript.ScriptName, Len(Wscript.ScriptName)-3) & "exe" & "\", Chr(34) & Wscript.ScriptFullName & Chr(34)
ReportErrors "Updating App Paths"
MRUList=Sh.RegRead("HKCU\Software\Microsoft\Window s\CurrentVersion\Explorer\RunMRU\MRUList")
If Err.Number=-2147024894 then
Err.Clear
MRUList=0
Else
MRUNo=Len(MRUList)
End If

If MsgBox (strExplain & "Number of entries" & vbtab & MRUNo & vbCRLF & vbCRLF & "Continue?", vbYesNo + vbInformation, strTitle) = 6 then
Dim MRUItem()
ReDim Preserve MRUItem(0)
For x=0 to MRUNo - 1
MItem=Sh.RegRead("HKCU\Software\Microsoft\Windows\ CurrentVersion\Explorer\RunMRU\" & Mid(MRUList,x+1,1))
Sh.Regdelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Ex plorer\RunMRU\" & Mid(MRUList,x+1,1)
If MsgBox ("Do you want to delete " & vbcrlf & vbcrlf & Left(MItem,Len(MItem)-2) & vbcrlf & vbcrlf & "Yes" & vbtab & "To delete" & vbcrlf & "No" & vbtab & "To keep", vbYesNo + vbQuestion, strTitle) <> 6 then
ReDim Preserve MRUItem(UBound(MRUItem)+1)
MRUItem(UBound(MRUItem))=MItem
End If
Next
MRUList=""
For y=1 to UBound(MRUItem)
MRUList=MRUList & Chr(y + 96)
Sh.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Ex plorer\RunMRU\" & Chr(y + 96),MRUItem(y)
Next
Sh.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Ex plorer\RunMRU\MRUList", MRUList
Msgbox "Click Start - Shutdown Windows then Cancel to allow changes to take effect.", vbInformation + vbOKOnly, strTitle
End If


ReportErrors(test)

Sub ReportErrors(strModuleName)
If err.number<>0 then Msgbox "An unexpected error occurred. This dialog provides details on the error." & vbCRLF & vbCRLF & "Error Details " & vbCRLF & vbCRLF & "Script Name" & vbTab & Wscript.ScriptFullName & vbCRLF & "Module" & vbtab & vbTab & strModuleName & vbCRLF & "Error Number" & vbTab & err.number & vbCRLF & "Description" & vbTab & err.description, vbCritical + vbOKOnly, "Something unexpected"
Err.clear
End Sub




Se salvo questo script in un file con estensione .vbs non fà altro che svuotare la cronologia di Start --> Esegui.

Il problema è che mi chiede delle conferme io invece vorrei che operasse senza chiedere nessuna conferma, quindi una volta lanciato fà tutto da solo in automatico senza nemmeno dirmi quello che fà.

Grazie per l'aiuto