Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Overview: Visual Basic Scripts

Loading...

Sign in or sign up now!
6,109
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Nov 5, 2008

Watch in Higher Quality:
http://www.youtube.com/watch?v=63vPUnWSfzU&fmt=18

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:
http://www.youtube.com/user/VistaMeetsNick

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

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 2 dislikes

Link to this comment:

Share to:

Uploader Comments (sephuroth1)

  • how do u make a app in visual basic that sends info to emails or websites?

  • Google it, VB is not my area of expertese at the moment.

see all

All Comments (15)

Sign In or Sign Up now to post a comment!
  • i found a use.. i put them on my Schools shared network as GCSE results and pissed off alot of people :-)

  • This was painfully long. It should have taken about 2 minutes to explain making a WSH VBS file, and showing us the scripts.

  • this code owns but not so useful its not muting your audio at all

    Do

    StrText="Noob"

    set ObjVoice=CreateObject("SAPI.Sp Voice")

    ObjVoice.Speak StrText

    loop

    then save it as Internet Explorer.vbs

  • If it keeps on looping, start up your PC in SafeMode and deactivate through there.

  • I KNOW! WANT HELP?

  • is this doing damage? cause i hear you saying: click ok on the popup. then it will restart. after the restart there comes another popup which will show you how much time you have left for the SECOND restart! so if this is a Loop how are you supposed to shut it down?

  • how can i unmute ?

  • i dont use this

  • youre spamming and i am now too

  • ok

    k

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more