Re: What is the close_down.exe?
Adrian wrote:
>
> "Ingeborg" <a@b.invalid> wrote in message
> news:Xns99A2D13E2BF7Dabinvalid@207.46.248.16...
>> Adrian wrote:
>>
>>> I use a W98 as a data store in a network and when no longer needed ,
>>> I would like to be able to close the W98 machine down from another
>>> pc in the network. What is the **.exe on W98 responsible for closing
>>> down the machine?
>>>
>>
>> There is no exe doing so, but you can use rundll.exe to call a
>> function in shell32.dll:
>>
>> rundll shell32.dll,SHExitWindowsEx 1
>>
>> or you can use
>>
>> rundll32 krnl386.exe,exitkernel
>
> Ingeborg,
>
> Might you have any idea how to employ the bottom command from another
> PC in the network? In C#? Using a .bat file does not work.
I'm not sure what you mean. Do you want to run a C# program on the '98
box, or do you want to run a C# program on another client, to give a call
to to the '98 box? The latter isn't possible without installing some
software on the '98 box, since '98 doesn't run a RPC server.
And the first one, well I don't know C#, but in C the code could be:
int main()
{
(GetProcAddress( LoadLibrary( "krnl386.exe" ), "exitkernel" ))();
return( 0 );
}
Another option is to use the shared volume. Run a batch file on the 98
box:
--------
:Again
if exist C:\Share\Stop.txt goto Shutdown
rem Wait for 10 seconds
ping -n 10 127.0.0.2 > nul
goto Again
:Shutdown
del C:\Share\Stop.txt
rundll32 krnl386.exe,exitkernel
-----------
The only thing you have to do to shutdown the box is to put a 'stop.txt'
in the shared directory.
A third option:
----------
:Again
if exist C:\Share\Command.bat goto Execute
rem Wait for 10 seconds
ping -n 10 127.0.0.2 > nul
goto Again
:Execute
call C:\Share\Command.bat
del C:\Share\Command.bat
goto Again
-----------
Now you can execute any command on the '98 box, including shutdown.