RemoteShutdown v2.1

Contents

Overview
Installation
What's New?
Usage
FAQ
History
Support
Legal

 

Overview

RemoteShutdown is a WindowsNT Administrator's utility that allows you to shutdown remote workstations (if you have sufficient privileges). You can specify whether the user is notified with an optional message and delay, or shutdown without warning. You can also specify an unconditional forced shutdown.

Options can be set via both a GUI and command-line interface.

To make full use of RemoteShutdown you must be running WindowsNT. Whilst you can still do local shutdowns under Windows95, remote shutdowns are not supported. Please see the FAQ for more information.

 

Installation

RemoteShutdown requires no special installation. Extract the files to their own directory, and run RemoteShutdown.exe. You may want to put a shortcut to it on your desktop or in your start menu.

RemoteShutdown will not touch your registry (it uses an "ini" file instead), so to uninstall it you just delete the directory again.

 

What's New?

 

Usage

You can run RemoteShutdown from either the command line or through the Windows User Interface (ie. normally).

Graphical User Interface (GUI)

The user interface is split into two tabs: Local and Remote.

Local Mode

In local mode you have the same choices as offered by the standard shutdown menu; namely Shutdown, Restart, or Log off & log on as another user.

You can also specify a forced shutdown. You should use this option with care, as it will not give applications a chance to close normally and save any unsaved data. It just blows them away unconditionally.

The default values for all the settings are loaded from RemoteShutdown.ini. If you wish to change the defaults to the current settings, then click the "Default" button when in local mode (NB: this does not change the settings for remote mode)

 

Remote Mode

In remote mode (assuming you are running Windows NT) you must specify the name of the workstation you wish to shutdown. This can be done by selecting from a list of ones you have typed previously (by using the drop list part of the input box), by using the browse button, or by typing the name in directly.

You can also specify a delay time. If this is specified then when you begin the shutdown, it will cause a dialog box to be raised on the target machine alerting the user that they are being shutdown. This dialog will show a countdown timer showing the remaining delay time and an optional message from you that you can specify in the message field. The dialog box also tells the user who is shutting them down.
You can also specify that the workstation should be automatically restarted after it has been shut down.

You can also specify a forced shutdown. . You should use this option with care, as it will not give applications a chance to close normally and save any unsaved data. It just blows them away unconditionally.

The default values for all the settings are loaded from RemoteShutdown.ini. If you wish to change the defaults to the current settings, then click the "Default" button when in remote mode (NB: this does not change the settings for local mode). The values in the drop list of computers are always saved, regardless of whether or not you press the "Default" button.

 

Command line

You can perform exactly the same actions with the command line mode of operation as the user interface one.

Remote mode

/remote:name

Specifies remote mode, and provides the name of the remote workstation

Required

/delay:value

Delay time in seconds before shutdown occurs

Optional

/msg:message

Message to display to user during delay

Optional

/r

Reboot after shutdown

Optional

/f

Force (CARE! - see UI section)

Optional

 

Local mode

/local:n

Specifies local mode, and type of shutdown.
0 = shutdown (default), 1 = restart, 2 = log off

Required (n optional)

/s

Shutdown (alternative to /local:0)

Optional*

/r

Restart (alternative to /local:1)

Optional*

/l

Log off (alternative to /local:2)

Optional*

/f

Force (CARE! - see UI section)

Optional

* Mutually exclusive. If you specify more the one of these then the rightmost will be taken.
These 3 options are retained for backward compatibility with the Restart application.

 

Return values

The following errorlevels are returned. Please see test.bat for an example of using these.

Value

enum

Description

1

NOT_NT

NT is required to run your selection, and you're not running NT.

2

BAD_PARAMS

You supplied incorrect parameters.

3

NO_PRIVS

You do not have sufficient privileges to do the shutdown

4

BAD_MACHINE

The machine name you specified cannot be found on the network

5

NOT_AVAILABLE

The machine name you specified was found, but is not available. Usually caused by trying to shut down a machine that is already shut down.

6

ACTION_FAILED

The shutdown action failed for some other reason.

 

Examples

RemoteShutdown /local:2

Logs you off your own machine, back to the logon prompt. You could use /l instead if you wanted.

RemoteShutdown /r

Restarts your machine. You could use /local:1 instead if you wanted.

RemoteShutdown /remote:wibble /delay:10 "/msg:seeya sucker"

Shuts down a workstation called wibble after displaying the message "seeya sucker" for 10 seconds. NB: because there was a space in the message, the whole parameter is enclosed in quotes.

 

Windows95 issues

See the FAQ below.

Other information

RemoteShutdown uses an initialisation file, RemoteShutdown.ini, which resides in your Windows directory (eg. \Windows or \WinNT) to store all its persistent information. This file is created the first time you run RemoteShutdown (or whenever it cannot find the file). You can change all the settings that RemoteShutdown uses from this file, although it is more advisable to make the changes through the user interface. The one exception to this is a setting that controls whether ToolTips should be used or not.

If you wish to disable ToolTips, then add the following two lines to your RemoteShutdown.ini:

[Options]
UseToolTips=0

 

FAQ

This section answers frequently asked questions (FAQs). Some of these questions are real ones that people have actually asked me, others are ones that I think may be asked.

 

So what will RemoteShutdown do for me?

It will make you rich and famous. Members of the opposite sex will throw themselves at you. It will solve all your problems overnight whether computational or otherwise.

 

Really?

No, not really. What RemoteShutdown will do for you though, is allow you to shut down machines over which you have administrative control, but not necessarily physical control (ie. it would be a real effort to actually physically go to the machine and shut it down normally).

 

Surely you've just put a fancy GUI round the Windows SDK program SMSBOOT?
Surely you've just ripped off the WinNT Resource Kit program ShutGUI?

Yes and No. SMSBOOT and RemoteShutdown both use the same SDK APIs (Software Development Kit Application Programming Interfaces), rather than RemoteShutdown just calling SMSBOOT as a DOS process. RemoteShutdown also lets you do local shutdowns, which SMSBOOT does not. Besides, SMSBOOT is not widely available and only has a command-line interface.

As for ShutGUI, I didn't even know it existed until 7 months after I wrote the first version of RemoteShutdown.

 

I'm still not convinced it's useful

If you don't have a need for remotely shutting down workstations then that’s Ok. Several people who have used it have found it to be invaluable. One user tells me that it saved him a 3 hour drive to a remote workstation that had hung and needed to be restarted.

 

Why does RemoteShutdown say "Windows 95 does not support shutting down remote workstations. It can only be done with WindowsNT" when I select the "remote" tab under Windows95? Can't you sort it out so that it works with Windows95?

The Win32 SDK function that I use to do remote shutdowns is only supported by Windows NT. This is because Windows95 does not support Remote Procedure Calls (RPCs).

I can think of ways of getting round this (by writing a client-server application that requires the target workstation to be running the client), but I can't see that it would help that many people and it would be a lot of work for me to do it. It would only really be of use when you have complete control over both machines (for example, the target machine being an unattended remote outstation that you have set up and then left running). If you're going to run in that kind of configuration for business-critical stuff, you should be running NT anyway. If you absolutely must have something that behaves like this, then contact me and I may agree to write it. But be prepared to pay freelance programmer's rates for it - it won't be free.

 

I'm using Windows95 and RemoteShutdown won't run at all in command-line mode.

You're probably in DOS mode (ie. you started Windows95 in "Command Prompt only" mode, or used "Shutdown and Restart in MS-DOS mode" under the Windows95 Shutdown menu). RemoteShutdown is a 32-bit Windows program and not a DOS utility. You should instead select "MS-DOS Prompt" from the Start menu and run RemoteShutdown or, less usefully, use the Run command on your Start menu.

 

Will you be bringing out a Windows 3.11 / DOS / OS/2 / BeOS / Unix / InsertNameHere version of RemoteShutdown?

No. But if you pay me lots and lots of money I might consider it. J

 

RemoteShutdown says that the remote computer denied my shutdown request. What gives?

The Win32 SDK manual says that in order "to shut down a remote computer, the calling process must have the SE_REMOTE_SHUTDOWN_NAME privilege on the remote computer. By default ... administrators can enable the SE_REMOTE_SHUTDOWN_NAME privilege on remote computers."

This means that the user account you are using on the machine initiating the shutdown (ie. the machine you are running RemoteShutdown.exe on) must be listed in the "Administrators" local group of your target machine. By default, when set up a workstation to log on to a Windows NT Domain Server, you set the "Domain Admins" group of your server to be a member of the "Administrators" local group of the workstation. However, if the user of the workstation has administrative control of their own machine then they can remove this, and then the domain administrator no longer has remote administrative control. It's crazy, but true. I'm looking at ways round it at the moment as I have exactly that problem at work. If you have a solution to this then please let me know - I've only really dabbled in NT Administration, as I'm a developer.

If you have complete control over both machines, you should make sure that the user account you are using on your own machine has admin privileges over the target machine. To do this, launch User Manager on the target machine and make sure that the "Administrators" group includes the username or group of the machine you intend to run RemoteShutdown on.

 

Do I have to be actually logged on to the machine I'm trying to shut down?

No. As mentioned above, so long as the user account you are using on your own machine has admin privileges over the target machine, then you should have no problems.

 

I want to run RemoteShutdown from my scheduler. It only seems to work when I'm logged on as the Administrator.

Please see the preceding two answers

 

I pressed the "Default" button to make my current settings the default ones whilst in local mode and it didn't save my remote mode settings (or vice versa)

Currently I keep the two entirely separate. I chose to do this as I felt there was a possibility of accidentally altering the defaults in the other mode when you didn't want to do that.

 

I checked the "Force apps to close" check-box in local mode, switched to remote mode, and it unchecked itself (or vice versa)

As mentioned above, I'm keeping local and remote modes entirely separate. A beta version did have the two linked, and it was felt that this caused confusion and meant that if you set the default to "forced" in remote mode, then you would set the default to "forced" in local mode too. You might not want this, so I unlinked them again.

 

I'm using WindowsNT v3.51 and I get the error "The ordinal 420 could not be located in the dynamic link library OLEAUT32.dll"

RemoteShutdown has not been tested with NT3.51. From the error message it looks like RemoteShutdown is trying to call a function in OLEAUT32.dll that does not exist in the version you have. The only advice I can give is to make sure you have the latest Service Pack for NT3.51 from Microsoft. Maybe that will fix it.

 

I'm using WindowsNT v3.51 and I find that I have problems doing a remote shutdown when the remote system does not have a user logged on at its console

Microsoft have confirmed this to be a problem (see Knowledge Base article Q140891). You will need to install a Service Pack to fix this.

 

I'd like to programmatically shut down a computer remotely in my own program. How do I do it, or is it a secret?

It's no secret. It's well documented in the Win32 SDK. The function you are looking for is InitiateSystemShutdown(...)

 

My program won't have System Administrator privileges. How do I do a local shutdown programmatically?

Use the Win32 function ExitWindowsEx(...)

 

What is the Win32 SDK? How do I get it?

If you have to ask this question then you are probably being a bit ambitious in wanting to do either local or remote shutdowns programmatically.
The Microsoft Windows 32-bit Software Development Kit (Win32 SDK for short) is available from Microsoft at their web site (http:\\www.microsoft.com\) in the developer's section. Most mainstream development environments including those from Microsoft and Borland (eg. Delphi 3.0) ship with the SDK as standard. Check your documentation - you may have it without realising it.

 

I don't have a development tool.

Doh!

 

I'd like you to write a special or extended version for me

I am available for part-time freelance work and would be happy to consider writing bespoke software for you. But it would not be cheap, and definitely not free.

 

I want more information about RemoteShutdown / you haven't answered my question. What do I do now?

If you still have questions about RemoteShutdown then feel free to email me at software.JonRB@dial.pipex.com and I'll do my best to answer your question. Please see the support section of this document for more information before you do this.

 

I emailed you ages ago. Why don't you reply / bring out a new version immediately / come round and clean my house for me?

Well, as you've probably noticed, RemoteShutdown is freeware. This is because I hold down a full-time programmer's job, and I just do these freeware utilities because I'm sad and have a hobby that is the same as my job. I'll get round to it when I feel like it. You get what you pay for with freeware. Having said that, most bug reports result in a fix fairly quickly - usually within a few days. But that isn't a promise.

 

You're my hero! Will you marry me?

Well, provided you're female and single then I'd love to hear from you. Otherwise I'll have to decline. Do feel free to send me money though. J

 

 

History

Version

Date

Reason

v1.0

12-JUL-97

First external release. Only had the user interface mode (no command-line) and did not do local shutdowns. Had no Windows95 functionality.

v2.0

08-DEC-97

Added command-line mode and improved user interface mode. Incorporated the local shutdown functionality of the Restart product.

v2.1

25-FEB-98

Added ToolTips, improved feedback options and improved documentation. Also added an ini file so that settings are carried over between sessions, and previous computer names are 'remembered'.

 

Support

By releasing this software as FREEWARE I am not committing myself to providing any support for it. My feeling is that if you get something for free you shouldn't feel that you then have the right to demand more stuff (like support).

However, I am willing to provide limited email support at my discretion. Please mail me at software.JonRB@dial.pipex.com stating your problem, with as much detail as possible. I'm afraid that emails that simply say "your software doesn't work" will not help much. I will look into the problem and may provide a workaround or bug fix.

I am afraid that I am not willing to provide any support via phone or fax, even if you phone me or otherwise pay for the call. I really don't appreciate people in different time zones phoning me in the middle of the night.

 

Legal

This program is released as FREEWARE. As such it may be used free of charge for personal use. Its use for commercial or academic purposes is prohibited without the author's express (and prior) permission.

This software is provided "as is". I take no responsibility for any loss, damage, heartache or problems it may cause, and make no guarantees as to its fitness of purpose. I have tried to ensure that it is as bug-free as possible, but again cannot guarantee that it is nor take responsibility for any damages that either directly or indirectly result. There are no warranties, either expressed or implied with this software.

You may freely distribute this software so long as either the original zip file or the files contained within it are distributed together and are not modified in any way. You may not sell this software to anyone, and may not charge anyone for distributing it. It may not be bundled in any CD or compilation without the author's prior written permission.

Copyright (C) 1997, 1998, Jon Roch-Berry. All rights reserved. All registered trademarks are recognised as belonging to their respective owners.