Hello Message and shut down computer vbs

Author Message
4CAMan

  • Total Posts : 11
  • Scores: 0
  • Reward points : 0
  • Joined: 1/9/2011
  • Location: VA, United States of America
  • Status: offline
Hello Message and shut down computer vbs Sunday, January 09, 2011 4:31 AM (permalink)
0
For ok = 0 To 1 Step 2
WScript.echo ("hello")
msgbox ("Are you having fun?")
msgbox ("Because I am.")
msgbox ("Let's have fun together!")
nextdim strShutDown,objShell
' -s = shutdown, -t 0 = no timeout, -f = force programs to close
strShutdown = "shutdown.exe -s -t 0 -f -m \\" & strComputer
set objShell = CreateObject("WScript.Shell")
objShell.Run strShutdown, 0, false
 
#1
    CØLLØSUS

    • Total Posts : 21
    • Scores: 0
    • Reward points : 0
    • Joined: 1/3/2011
    • Status: offline
    Re:Hello Message and shut down computer vbs Sunday, January 09, 2011 10:04 PM (permalink)
    0
    its Cool.. but it didnt work for me
     
    #2
      4CAMan

      • Total Posts : 11
      • Scores: 0
      • Reward points : 0
      • Joined: 1/9/2011
      • Location: VA, United States of America
      • Status: offline
      Re:Hello Message and shut down computer vbs Sunday, January 09, 2011 11:55 PM (permalink)
      0
      found the problem: when I copy my vbscripts, it puts all the code on one line.  I accidentally forgot to hit enter again after the next when i was separating them into individual lines again.  Here is the fixed vbscript ('next' and 'dimshutdown,objshell' are on two different lines)
      ======================================
      For ok = 0 To 1 Step 2
      WScript.echo ("hello")
      msgbox ("Are you having fun?")
      msgbox ("Because I am.")
      msgbox ("Let's have fun together!")
      next
      dim strShutDown,objShell
      ' -s = shutdown, -t 0 = no timeout, -f = force programs to close
      strShutdown = "shutdown.exe -s -t 0 -f -m \\" & strComputer
      set objShell = CreateObject("WScript.Shell") 
      objShell.Run strShutdown, 0, false
       
      #3
        CØLLØSUS

        • Total Posts : 21
        • Scores: 0
        • Reward points : 0
        • Joined: 1/3/2011
        • Status: offline
        Re:Hello Message and shut down computer vbs Monday, January 10, 2011 2:02 AM (permalink)
        0
        Now it works,
        you should try making a calculator
         
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • 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
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.9