Page 1 of 1 1
Topic Options
#43615 - 2003-08-01 01:56 PM Shutdown commando (u kunt nu de computer uitzetten) w2k
Teddy Beer Offline
Lurker

Registered: 2003-08-01
Posts: 2
Loc: Holland
ik wil graag meerdere machines afsluiten, onderstaand script werkt wel maar de machine sluit niet af

script
code:
 goto "down"
goto "end"
:down
If 1
$RC = Shutdown("wks03020", "Het is 11 uur het systeem wordt afgesloten.", 10, 0, 1)
ENDIF
RETURN

:END
Exit

_________________________
Als je de bank 1000 euro schuldig bent, heb jij een probleem. Maar als je de bank een miljoen euro schuldig bent, hebben zij een probleem. (John Maynard Keynes)

Top
#43616 - 2003-08-01 02:17 PM Re: Shutdown commando (u kunt nu de computer uitzetten) w2k
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Teddy,

welkom op het BB. Wil je je vraag svp in het engels plaatsen, Dan kunnen meerder mensen je proberen te helpen...

(continuing in English)

A few questions:

** Why this structure of jumping forward, doing something, returning and jumping forward again???
** What KiX version are you using???
** What client OS???

Back to topic; From the manual:

quote:

SHUTDOWN

Action
Shuts down or reboots a computer.

Syntax
SHUTDOWN ("computer", "message", wait, force, options)

Parameters

Computer
The name of the computer that is to be shut down or rebooted. An empty string("") indicates the local computer.

Message
String that specifies a message to display in the Shutdown dialog box.

Wait
Optional parameter specifying the time in seconds that the dialog box is displayed. While the dialog box is displayed, system shutdown can be stopped by using the Win32 AbortSystemShutdown function.
If wait is not zero, SHUTDOWN displays a dialog box on the specified computer. The dialog box, which displays the name of the user who called the function and the message specified by message, prompts the user to log off. The system beeps when the dialog box is created.
The dialog box remains on top of other windows and can be moved but not closed. A timer counts down the time remaining before a forced shutdown. If the user logs off, the system shuts down immediately. Otherwise, the computer is shut down when the timer expires.
If wait is zero, the computer shuts down without displaying the dialog box, and the shutdown cannot be stopped by AbortSystemShutdown.

Force
Specifies whether applications with unsaved changes are forcibly closed. If force is not zero, applications are closed. If force is zero, a dialog box is displayed prompting the user to close the applications.

Options
Optional parameter specifying one of the following options.

Value Action
1 Reboot computer after shutdown.
2 Poweroff the system after shutdown (NB: this option only works for the local system).

Returns

0 Computer shut down
System error code Function failed

Remarks
SHUTDOWN does not work reliably on Windows 9x due to an issue in the underlying Windows API. As a workaround, the following command can be used:
SHELL "%windir%\RUNDLL32.EXE user.exe,ExitWindows"

Example
$RC = Shutdown("", "System is being rebooted to enable new settings.", 60, 0, 1)


Resulting in:

code:
$RC = Shutdown("wks03020", "Het is 11 uur het systeem wordt afgesloten.", 10, 1, 2)

Shutdown/Poweroff will only work for local system!!!
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#43617 - 2003-08-01 03:01 PM Re: Shutdown commando (u kunt nu de computer uitzetten) w2k
Teddy Beer Offline
Lurker

Registered: 2003-08-01
Posts: 2
Loc: Holland
A. Why this structure of jumping forward, doing something, returning and jumping forward again???
** What KiX version are you using???
** What client OS???

A. starting and testing kixtart
Target is running this script at 11 pm closing all workstations
B. kix= 4.20
i am testing 4.21 at the moment
C. os= w2k pro sp3

in your answer i understand its not possible to down all of my machines with one script started from one pc
_________________________
Als je de bank 1000 euro schuldig bent, heb jij een probleem. Maar als je de bank een miljoen euro schuldig bent, hebben zij een probleem. (John Maynard Keynes)

Top
#43618 - 2003-08-01 03:15 PM Re: Shutdown commando (u kunt nu de computer uitzetten) w2k
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Please use 4.21...

Shutdown on all PC's could be done, but not with native KiX commands...

[Big Grin] But then there are UDFs [Big Grin]

Take a look at
http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=12;t=000301

It will do the trick!!!
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#43619 - 2003-08-01 06:55 PM Re: Shutdown commando (u kunt nu de computer uitzetten) w2k
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
quote:
Shutdown on all PC's could be done, but not with native KiX commands...

The native SHUTDOWN command supports remote computers. Thus
code:
$comps=comnetview()
for each $com in $comps
if $comp<>@WKSTA
$rc=shutdown($comp,'Shutting down...',0,1,0)
endif
next
$rc=shutdown(@WKSTA,'Shutting down...',0,1,0)

will shut everything down. COMNetView() is in the UDF Forum.

[ 01. August 2003, 18:56: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 640 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.051 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org