Overview: Visual Basic Scripts

Published: 05 November 2008
on channel: sephuroth1
7,759
9

Watch in Higher Quality:
   • Overview: Visual Basic Scripts  

Today's focus is something of a different nature.

I'm going to focus on two different scripts that have different actions essentially.

Mute Script:
set oShell = CreateObject("WScript.Shell")
oShell.run"Sndvol32"
WScript.Sleep 1500
oShell.SendKeys"{TAB 2} "
oShell.SendKeys"%{F4}"



Reboot Script:
Option Explicit
On Error Resume Next
Dim Wsh, Time1, Time2, Result, PathFile, MsgResult, MsgA, AppName, KeyA, KeyB, TimeDiff
MsgA = "Please close all running applications and click on OK."
KeyA = "HKEY_CURRENT_USER\Software\RestartTime\ "
KeyB = "HKEY_CURRENT_USER\Software\Microsoft\Wi ndows\CurrentVersion\Run\RestartTime"
AppName = "ReBoot-Time"
Set Wsh = CreateObject("WScript.Shell")
PathFile = """" & WScript.ScriptFullName & """"
Result = wsh.RegRead(KeyA & "Times")
if Result = "" then
MsgResult = Msgbox (MsgA, vbOKCancel, AppName)
If MsgResult = vbcancel then WScript.Quit
Wsh.RegWrite KeyA & "Times", left(Time,8), "REG_SZ"
Wsh.RegWrite KeyB, PathFile, "REG_SZ"
Wsh.Run "cmd /c Shutdown -r -t 00", false, 0
else
Wsh.RegDelete KeyA & "Times"
Wsh.RegDelete KeyA
Wsh.RegDelete KeyB
TimeDiff = DateDiff("s",Result,left(Time,8))
MsgBox "Your computer reboots in " & TimeDiff & " seconds", VbInformation, AppName
end if
wscript.Quit

Thanks to VistaMeetsNick for the directions:
   / vistameetsnick  

Any questions? Check out my channel to find different ways of reaching me.


On this page of the site you can watch the video online Overview: Visual Basic Scripts with a duration of hours minute second in good quality, which was uploaded by the user sephuroth1 05 November 2008, share the link with friends and acquaintances, this video has already been watched 7,759 times on youtube and it was liked by 9 viewers. Enjoy your viewing!