Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


scripts for WHS and VBscript intro classes

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,56549
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> scripts for WHS and VBscript intro classes
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 scripts for WHS and VBscript intro classes - 2/11/2008 3:14:57 AM   
  drawls

 

Posts: 4
Score: 0
Joined: 2/11/2008
Status: offline
option explicit
dim num1
dim num2
dim sum
dim diff
dim mult
dim div

num1 = inputbox("Enter the first number.")
num2 = inputbox("Enter the second number.")
sum = cint(num1) + cint(num2)
diff = num1 - num2
mult = num1 * num2
div = num1 / num2

msgbox "The sum is: " & sum & vbcrlf & "The differance is: " & diff & vbcrlf & _
"The multiple is: " & mult & vbcrlf & "The division is: " & div, vbokonly, "Number Products"

 
 
 
Set WshNtwk = WScript.CreateObject("WScript.Network")
PropertyInfo =  "Computer Name" & vbTab & "=   " & WshNtwk.ComputerName  & vbCrLf & "User Name"   & vbTab & "=   " & WshNtwk.UserName   & vbCrLf
titlebar = "User Domain" & vbTab & "=   " & WshNtwk.UserDomain
MsgBox PropertyInfo, vbOkOnly , titlebar

 
 
Set WshShl = WScript.CreateObject("WScript.Shell")
WshShl.LogEvent 1, "Problem 4"

 
 
 
option explicit
dim wshshl
set wshshl = wscript.createobject("wscript.shell")
wshshl.run "wordpad"
wscript.sleep 2000
wshshl.sendkeys "****"
wshshl.sendkeys "~"
wshshl.sendkeys "**********"

 
 
 
 
option explicit
dim input1
dim mess

input1 = inputbox("Enter a number or letter")
if isnumeric(input1) then
mess = "The input was a number"
else
mess = "The input was not a number"
end if

msgbox mess

 
 
 
 
option explicit
dim num1
dim numArray()
dim intcount
dim strmsg
dim count

num1 = inputbox("Enter a number for the array")
redim numArray(num1)
count = 1
for each intcount in numArray
strmsg = strmsg & count & " "
count = cint(count) + 1
next

msgbox strmsg
 
 
 
 
 
option explicit
redim numArray(9)
dim newnum
dim strmsg
dim x
dim arrnum

arrnum = 0
numArray(0) = 1
numArray(1) = 2
numArray(2) = 3
numArray(3) = 4
numArray(4) = 5
numArray(5) = 6
numArray(6) = 7
numArray(7) = 8
numArray(8) = 9
numArray(9) = 10

redim preserve numArray(10)
newnum = inputbox("Enter a number to add to the array")
numArray(10) = newnum

for each x in numArray
strmsg = strmsg & numArray(arrnum) & " "
arrnum = cint(arrnum) + 1
next

msgbox strmsg

< Message edited by drawls -- 2/11/2008 4:50:49 AM >
 
 
Revisions: 1 | Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> scripts for WHS and VBscript intro classes Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts