Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Autorunner v1.0.2
- 'https://pastebin.com/u/jcunews
- 'https://www.reddit.com/user/jcunews1
- '
- 'Script to simply execute Autorun applications in the registry.
- 'This script will not restart Autorun applications which are already running.
- 'Nirsoft's disabled Autorun applications will not be processed.
- '
- 'Usage: autorunner RUN [/Y]"
- '
- 'RUN = Required command to run Autorun applications. Otherwise, usage help will be shown instead.
- '/Y = Supress prompting and run all (enabled) Autorun applications.
- if wsh.arguments.unnamed.count > 0 then
- e = ucase(wsh.arguments.unnamed(0)) = "RUN"
- else
- e = false
- end if
- if not e then
- msgbox "Usage: autorunner RUN [/Y]" & vbcrlf & vbcrlf & _
- "/Y = supress prompting and run all Autorun applications", 64, "Autorunner"
- wsh.quit
- end if
- set ws = createobject("wscript.shell")
- set rg = getobject("winmgmts:stdregprov")
- ky = "Software\Microsoft\Windows\CurrentVersion\Run"
- for rt = 2147483650 to 2147483649 step -1
- na = empty
- ta = empty
- if rg.enumvalues(rt, ky, na, ta) = 0 then
- for i = 0 to ubound(na)
- select case ta(i)
- case 1
- e = rg.getstringvalue(rt, ky, na(i), s)
- case 2
- e = rg.getexpandedstringvalue(rt, ky, na(i), s)
- case else
- e = 1
- end select
- if s <> "" then if left(s, 1) = ":" then e = 1 'Nirsoft's disabled entry
- if e = 0 then
- if wsh.arguments.named.exists("Y") then
- e = 6 'yes
- else
- e = msgbox("Run this Autorun application?" & vbcrlf & vbcrlf & _
- "Name: " & vbcrlf & na(i) & vbcrlf & vbcrlf & "Command line:" & _
- vbcrlf & s, 35 + 4096, "Autorunner")
- end if
- if e = 6 then 'yes
- on error resume next
- ws.run s, 1
- on error goto 0
- elseif e = 2 then 'cancel
- wsh.quit
- end if
- end if
- next
- end if
- next
Add Comment
Please, Sign In to add comment