Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Script per spegnimento automatico Windows

2 views
Skip to first unread message

modris

unread,
Jun 10, 2006, 5:15:17 AM6/10/06
to
Salve,
mi potreste indicare uno script che una volta avviato mi permetta di
spegnere il pc (conosco solo questo C:WINDOWSRUNDLL32.EXE
user.exe,exitwindows)e che prima della chiusra mi permetta di impostare una
frase a mio piacimento tipo Goodbye?Grazie.


Reventlov (see signature)

unread,
Jun 11, 2006, 5:26:38 PM6/11/06
to

in vbscript puoi usare il metodo popup che permette di visualizzare una finestra per un
certo periodo di tempo e poi chiuderla automaticamente.

Popup Method
Displays text in a pop-up message box.

intButton = object.Popup(strText,[nSecondsToWait],[strTitle],[nType])
Arguments
object
WshShell object.
strText
String value containing the text you want to appear in the pop-up message box.
nSecondsToWait
Optional. Numeric value indicating the maximum length of time (in seconds) you want the
pop-up message box displayed.
strTitle
Optional. String value containing the text you want to appear as the title of the pop-up
message box.
nType
Optional. Numeric value indicating the type of buttons and icons you want in the pop-up
message box. These determine how the message box is used.
IntButton
Integer value indicating the number of the button the user clicked to dismiss the message
box. This is the value returned by the Popup method.
Remarks
The Popup method displays a message box regardless of which host executable file is
running (WScript.exe or CScript.exe). If nSecondsToWaitis equals zero (the default), the
pop-up message box remains visible until closed by the user. If nSecondsToWaitis is
greater than zero, the pop-up message box closes after nSecondsToWait seconds. If you do
not supply the argument strTitle, the title of the pop-up message box defaults to "Windows
Script Host." The meaning of nType is the same as in the Microsoft Win32® application
programming interface MessageBox function. The following tables show the values and their
meanings. You can combine values in these tables.

Note To display text properly in RTL languages such as Hebrew or Arabic, add hex
&h00100000 (decimal 1048576) to the nType parameter.
Button Types

Value Description
0 Show OK button.
1 Show OK and Cancel buttons.
2 Show Abort, Retry, and Ignore buttons.
3 Show Yes, No, and Cancel buttons.
4 Show Yes and No buttons.
5 Show Retry and Cancel buttons.

Icon Types

Value Description
16 Show "Stop Mark" icon.
32 Show "Question Mark" icon.
48 Show "Exclamation Mark" icon.
64 Show "Information Mark" icon.

The previous two tables do not cover all values for nType. For a complete list, see the
Microsoft Win32 documentation.

The return value intButton denotes the number of the button that the user clicked. If the
user does not click a button before nSecondsToWait seconds, intButton is set to -1.

Value Description
1 OK button
2 Cancel button
3 Abort button
4 Retry button
5 Ignore button
6 Yes button
7 No button

Example
The following code generates a simple pop-up window.

[VBScript]
Dim WshShell, BtnCode
Set WshShell = WScript.CreateObject("WScript.Shell")

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


--
Giovanni Cenati (Aosta, Italy)
Write to user "Reventlov" and domain at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--

0 new messages