Webmaster Forum

Go Back   Webmaster Forum > Scripting/Programming & Debugging > ASP & VBScript Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

ASP & VBScript Forum Need help from a webmaster with ASP or VBScript, you may ask in this forum?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-26-2007, 11:28 AM
fredde76 fredde76 is offline
Junior Member
 
Join Date: Sep 2007
Posts: 1
fredde76 is an unknown quantity at this point
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Lightbulb Help me save the planet with this script...

Hi!

First I have to say I´m a total newbie on VBScript.

I want to do a VBscript that turns the computer off at a specific time incase I forget to turn it off at night. This is good for the environment and also my powerbill.

My plan is to add the script i scheduled tasks in windows, to be run at 20:00 every day. However I do not want the script to complete starting shutdown.exe if Im still working with something. Therefore it would be brilliant if The script can do:

1] a messagebox with some information to the user
2] a pause or timeoutfunction, (a countdown for 300 secounds or so)
3] a cancelbutton that allows the user to terminate the script before shutdown.exe starts.

This is how I start shutdown.exe

Set oShell = CreateObject("Wscript.Shell")
oShell.CurrentDirectory = "C:\Windows\system32"
oShell.Run "C:\Windows\shutdown.exe -s -f"

Could somebody help me with this, please!
Reply With Quote

This ad is part of our Revenue Sharing program
  #2 (permalink)  
Old 09-26-2007, 08:03 PM
ALL's Avatar
ALL ALL is offline
Senior Member
 
Join Date: Oct 2006
Location: Sturgis, SD
Posts: 145
ALL is on a distinguished road
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default

ok yes that is possable, but not eassy. Dependiing if you are using more of a visual basic application rather than a visual basic script, because if it's a vbscript you cannot display a message box and have a timer, because when you use a msgbox it stops the script from running completely, until the user responds. However, there is a way around this. If you make 2 vbscripts, one to ask the question and write to a file, and the other the check the file, then yes it is possable.

my suggestion, use another language to do this sort of thing, such as VB.NET/VB6/Delphi or even PHP can do it eassier than VBS.

-ALL
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auction script? detoam PHP Forum 2 04-07-2007 04:32 AM


All times are GMT. The time now is 03:16 AM.


Creative Commons License
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30