Guest Adrian Posted September 5, 2007 Posted September 5, 2007 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? Thank you, Adrian.
Guest Ingeborg Posted September 5, 2007 Posted September 5, 2007 Re: What is the close_down.exe? 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
Guest Adrian Posted September 5, 2007 Posted September 5, 2007 Re: What is the close_down.exe? "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, Thank you very much. Adrian.
Guest Adrian Posted September 6, 2007 Posted September 6, 2007 Re: What is the close_down.exe? "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. Adrian.
Guest Ingeborg Posted September 6, 2007 Posted September 6, 2007 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.
Guest Adrian Posted September 6, 2007 Posted September 6, 2007 Re: What is the close_down.exe? Ingeborg, (a) I have a "command.bat" in Shared Documents containing: rundll32 krnl386.exe,exitkernel (b) I have a "StopW98.bat" in Shared Documents containing: :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 © I run "StopW98" (d) The display repeats following: C:\Windows>rem Wait for 10 seconds C:\Windows>ping -n 10 127.0.0.2 > nul --- Sorry, I must be doing something very stupid, in spite of your much appreciated response to my query. Could you please give another leg-up? Thank you, Adrian.
Guest Ingeborg Posted September 6, 2007 Posted September 6, 2007 Re: What is the close_down.exe? Adrian wrote: > Ingeborg, > > (a) I have a "command.bat" in Shared Documents containing: > > rundll32 krnl386.exe,exitkernel > > (b) I have a "StopW98.bat" in Shared Documents containing: > >: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 > > © I run "StopW98" > > (d) The display repeats following: > > C:\Windows>rem Wait for 10 seconds > C:\Windows>ping -n 10 127.0.0.2 > nul > > --- > > Sorry, I must be doing something very stupid, in spite of your much > appreciated response to my query. > Could you please give another leg-up? > I suppose C:\Share is not the real local folder in the '98 box, and I also suppose you changed the path in StopW98.bat? Maybe the real path contains spaces. In that case you need to use quotes on all places where the path is used: if exist "C:\Windows\Shared Documents\Command.bat" goto Execute By the way, the StopWin98.bat doesn't need to be on the share. It can be a local file on the W98 box.
Guest Adrian Posted September 6, 2007 Posted September 6, 2007 Re: What is the close_down.exe? Ingeborg, Hopefully you have some patience left with me. I have created a "Shared" file in C:\ In Shared I have created both "Command.bat" and "StopW98.bat. I get the following error message: '\\W98\C\Shared' CMD.exe was started with the above path as the current directory. UNC paths are not supported. Defaulting to the Windows directory. I then put "Shared" plus the two *.bat files in C:\Windows additionally I put Command.bat and StopW98.bat in C:\Windows separately. However, the bat file keeps on looping back, and seems unable to locate Command.bat (containing the closing command). Adrian.
Guest Ingeborg Posted September 6, 2007 Posted September 6, 2007 Re: What is the close_down.exe? Adrian wrote: > Ingeborg, > > Hopefully you have some patience left with me. > Patience is my middle name. > I have created a "Shared" file in C:\ > In Shared I have created both "Command.bat" and "StopW98.bat. > > I get the following error message: > '\\W98\C\Shared' > CMD.exe was started with the above path as the current directory. > UNC paths are not supported. Defaulting to the Windows directory. You did not start it on the W98 box, did you? Cmd.exe is typical for NT flavours of Windows, like XP. A W98 box would have mentioned command.com instead. This warning doesn't matter, it should still work, as long as all 'C:\Share\Command.bat' entries in StopW98.bat are exchanged with '\\W98\C\Shared\Command.bat' It should find and execute command.bat (On an XP machine command.bat will not work, but generate a nice errormessage) Try to exchange the line if exist C:\Share\Command.bat goto Execute by notepad C:\Share\Command.bat Notepad should open command.bat. If not, you somehow gave the wrong path. It can be something small which you can look over and over. Try to create a shortcut to command.bat. Rightclick the shortcut, choose properties, and you can copy the content of 'Target'. (or 'Cmd line' depending if you do this from XP or 98) I tried the construction on a W98 box, and it worked. However, there's a bug. In the batchfile I posted, 'del command.bat' was not called because windows was already down. That will cause a problem when StopWin98.bat is called from the startup entry in the startmenu. A solution could be: :OuterLoop del C:\Shared\Command.bat :InnerLoop if exist C:\Shared\Command.bat goto Execute rem Wait for 10 seconds ping -n 10 127.0.0.2 > nul goto InnerLoop :Execute call C:\Shared\Command.bat goto OuterLoop
Guest Adrian Posted September 6, 2007 Posted September 6, 2007 Re: What is the close_down.exe? Ingeborg, I was calling "StopW98" from an XP box. That was the whole object, namely to close down the W98 from another box. I cannot continue the bug search right now because in the mean time some hardware has blow up :( and I need to get it back to the shop. I would like to let you know later on how I got on with the *bat files. Thank you enormously for your patience so far. Great! Regards, Adrian.
Guest Ingeborg Posted September 6, 2007 Posted September 6, 2007 Re: What is the close_down.exe? Adrian wrote: > Ingeborg, > > I was calling "StopW98" from an XP box. That was the whole object, > namely to close down the W98 from another box. I know. My idea was that StopW98 would run on the W98 box. When the W98 box has to shutdown, the XP box can put command.bat on the share, and W98 would execute it, just because it exists. (Good reason, hmm?) > I cannot continue the > bug search right now because in the mean time some hardware has blow > up :( and I need to get it back to the shop. I would like to let you > know later on how I got on with the *bat files. Thank you enormously > for your patience so far. Great! You're welcome.
Guest Adrian Posted September 6, 2007 Posted September 6, 2007 Re: What is the close_down.exe? Ingeborg, Thank you very much for your help. You have been very patient with me. I am giving up though. Sorry. ... I feel I owe you an explanation ... The bit of hardware that freaked out was a KVM-switch that I used for running two boxes. I wanted to be able to shut down one of the boxes (the W98 which I use as a data store) without having to change screens. However the new KVM-switch freaks as well (the screen goes all funy colors, waving about like a flag). After searching around for many hours I have come to the conclusion that the power isn't stable and that the KVM-switch is power-sensitive. So now I am back to an extra screen and don't need the close down from the XPP any longer. A long story, but I thought I owed it to you after all your good help. Whereabouts are you in the universe (I'm in the Netherlands)? Best regards, Adrian.
Guest Jeff Richards Posted September 6, 2007 Posted September 6, 2007 Re: What is the close_down.exe? Perhaps the problem with what you were trying to do is that W98 will not shut down while there is an open DOS session (the one looping through that batch file.) I have seen a similar problem with a KVM switch where the video card didn't like to have to monitor disconnected. It wasn't a problem with the switch. When the video output was reconnected with the switch, the video card refused to lock onto a suitable sync rate for the monitor. -- Jeff Richards MS MVP (Windows - Shell/User) "Adrian" <xx@xx.xx> wrote in message news:46e07119$0$24399$5fc3050@news.tiscali.nl... > Ingeborg, > > Thank you very much for your help. You have been very patient with me. I > am giving up though. Sorry. ... I feel I owe you an explanation ... The > bit of hardware that freaked out was a KVM-switch that I used for running > two boxes. I wanted to be able to shut down one of the boxes (the W98 > which I use as a data store) without having to change screens. However the > new KVM-switch freaks as well (the screen goes all funy colors, waving > about like a flag). After searching around for many hours I have come to > the conclusion that the power isn't stable and that the KVM-switch is > power-sensitive. So now I am back to an extra screen and don't need the > close down from the XPP any longer. A long story, but I thought I owed it > to you after all your good help. Whereabouts are you in the universe (I'm > in the Netherlands)? Best regards, Adrian. >
Guest Adrian Posted September 6, 2007 Posted September 6, 2007 Re: What is the close_down.exe? "Jeff Richards" <JRichards@msn.com.au> wrote in message news:e2SxlkN8HHA.4584@TK2MSFTNGP03.phx.gbl... > Perhaps the problem with what you were trying to do is that W98 will not > shut down while there is an open DOS session (the one looping through that > batch file.) > > I have seen a similar problem with a KVM switch where the video card > didn't like to have to monitor disconnected. It wasn't a problem with the > switch. When the video output was reconnected with the switch, the video > card refused to lock onto a suitable sync rate for the monitor. > -- Hi Jeff, as to shutting down the W98 from another box in the network, and with respect to the KVM-switch for that matter, you have to say "stop, no more" at some stage. Adrian.
Guest Adrian Posted September 7, 2007 Posted September 7, 2007 Re: What is the close_down.exe? Jeff, I do recall lots of messages on the display to do with frequency. This supports your remark about the video card. Regards, Adrian. "Jeff Richards" <JRichards@msn.com.au> wrote in message news:e2SxlkN8HHA.4584@TK2MSFTNGP03.phx.gbl... > Perhaps the problem with what you were trying to do is that W98 will not > shut down while there is an open DOS session (the one looping through that > batch file.) > > I have seen a similar problem with a KVM switch where the video card > didn't like to have to monitor disconnected. It wasn't a problem with the > switch. When the video output was reconnected with the switch, the video > card refused to lock onto a suitable sync rate for the monitor.
Guest Ingeborg Posted September 7, 2007 Posted September 7, 2007 Re: What is the close_down.exe? Jeff Richards wrote: > Perhaps the problem with what you were trying to do is that W98 will > not shut down while there is an open DOS session (the one looping > through that batch file.) I tested it on a W98 box, and it worked. Calling rundll32 krnl386.exe,exitkernel from a batch file shuts down windows immediately, bypassing all 'Do you want to save this?' and 'Cannot stop this command prompt' messages.
Guest Ingeborg Posted September 7, 2007 Posted September 7, 2007 Re: What is the close_down.exe? Adrian wrote: > Ingeborg, > > Thank you very much for your help. You have been very patient with me. > I am giving up though. Sorry. ... I feel I owe you an explanation ... > The bit of hardware that freaked out was a KVM-switch that I used for > running two boxes. I wanted to be able to shut down one of the boxes > (the W98 which I use as a data store) without having to change > screens. However the new KVM-switch freaks as well (the screen goes > all funy colors, waving about like a flag). After searching around for > many hours I have come to the conclusion that the power isn't stable > and that the KVM-switch is power-sensitive. So now I am back to an > extra screen and don't need the close down from the XPP any longer. Who is talking about need? It should be fun. I have an old PC running W95 without screen or keyboard in the basement. You can switch it on by WakeOnLan, and I wrote a little program for it that pings a number of IP addresses, and it shuts itself down when it feels alone. (One pitfall, I had to turn off the 'Automatic daylight saving'. It will twice a year show a messagebox that it changed the time, and I had to connect a monitor and keyboard just to get that silly box away.) > A long story, but I thought I owed it to you after all your good help. > Whereabouts are you in the universe (I'm in the Netherlands)? Me too. Small world.
Guest Adrian Posted September 7, 2007 Posted September 7, 2007 Re: What is the close_down.exe? "Ingeborg" <a@b.invalid> wrote in message news:Xns99A4613302B27abinvalid@194.109.133.133... > Adrian wrote: > >> Ingeborg, >> >> Thank you very much for your help. You have been very patient with me. >> I am giving up though. Sorry. ... I feel I owe you an explanation ... >> The bit of hardware that freaked out was a KVM-switch that I used for >> running two boxes. I wanted to be able to shut down one of the boxes >> (the W98 which I use as a data store) without having to change >> screens. However the new KVM-switch freaks as well (the screen goes >> all funy colors, waving about like a flag). After searching around for >> many hours I have come to the conclusion that the power isn't stable >> and that the KVM-switch is power-sensitive. So now I am back to an >> extra screen and don't need the close down from the XPP any longer. > > Who is talking about need? It should be fun. I have an old PC running W95 > without screen or keyboard in the basement. You can switch it on by > WakeOnLan, and I wrote a little program for it that pings a number of IP > addresses, and it shuts itself down when it feels alone. (One pitfall, I > had to turn off the 'Automatic daylight saving'. It will twice a year show > a messagebox that it changed the time, and I had to connect a monitor and > keyboard just to get that silly box away.) > >> A long story, but I thought I owed it to you after all your good help. >> Whereabouts are you in the universe (I'm in the Netherlands)? > Being able to run a W98 without a display or keyboard circumventss the bug stuff I was facing, and inspires new life into the project. Did you make the W95 box not want a keyboard electronically, or with code? As to the *.bat files: they worked ok if activated on the W98 box, but not when called from another box on the network (The shut-down code produced an error: "no Windows image"). I will have to give your code more tries, in view of the preceding. "Me too. Small world." In Groningen as well? Your English is awfully good, so not Dutch I'd say. Adrian,
Guest Ingeborg Posted September 7, 2007 Posted September 7, 2007 Re: What is the close_down.exe? Adrian wrote: > > Being able to run a W98 without a display or keyboard circumventss the > bug stuff I was facing, and inspires new life into the project. Did > you make the W95 box not want a keyboard electronically, or with code? > W9x doesn't need a keyboard at all. It's the BIOS who wants it. 'No Keyboard found. Press F1 to continue'. You can switch this off in BIOS setup. Something like 'Halt on all errors' which should be 'Halt on nothing'. > As to the *.bat files: they worked ok if activated on the W98 box, but > not when called from another box on the network. That's right. W98 has no way to be shutted down from outside, because it doesn't run any services to do so. So you'll have to run some software *on the '98 box*. In this case Win98Stop.bat. Put it in the startup folder, and it will start with windows startup, and run forever. The idea is that it will poll the share for existance of some other batchfile, and execute it locally on the Win98 box. So the XP box can put the Command.bat on the share, and the 98 box will execute it locally. > (The shut-down code produced an error: "no Windows image"). An understatement. Actually there is no krnl386.exe at all on a XP box. > "Me too. Small world." In Groningen as well? No. The world is slightly bigger. Limburg.
Guest Adrian Posted September 7, 2007 Posted September 7, 2007 Re: What is the close_down.exe? Ingeborg, when you said "Run a batch file on the W98 box", did you mean to say, put a reference to the batch-file in thautoexec.bat of the W98 box, so it will sort of keep on running in the background? Limburg: near Liège: super opera house there. Adrian.
Guest Ingeborg Posted September 7, 2007 Posted September 7, 2007 Re: What is the close_down.exe? Adrian wrote: > Ingeborg, when you said "Run a batch file on the W98 box", did you > mean to say, put a reference to the batch-file in thautoexec.bat of > the W98 box, so it will sort of keep on running in the background? Sort of. Not in autoexec.bat. Autoexec.bat is parsed before windows will start, so putting a never ending script here will prevent Windows from starting. You can put it in the Startup folder from the startmenu: 1. Right-Click on Start and choose Open. 2. Double-click Programs. 3. Double-click StartUp and add a shortcut for any program you want to load automatically. The program will be launched when explorer is loaded. (BTW, you can bypass this by keeping <shift> pushed while windows is starting. Can be nice when some startup entry causes windows to crash, or, more likely in your case, causes windows to shutdown immediately.
Guest Adrian Posted September 7, 2007 Posted September 7, 2007 Re: What is the close_down.exe? Ingeborg, I don't know what happened yesterday when I tried your code. Had it in a couple of minutes today. Many apologies. Oh man. Adrian.
Guest Adrian Posted September 7, 2007 Posted September 7, 2007 Re: What is the close_down.exe? Ingeborg, There is nothing about keyboards in the BIOS, it only detects hdd and display as far as I can see. I wrote a simple compiled QBasic program for the other boxes to put a text-file in "Share". (QBasic can be very convenient for basic requirements.) Nice stuff! Creates lots of room on my desk! Thank you again. Adrian.
Guest Adrian Posted September 7, 2007 Posted September 7, 2007 Re: What is the close_down.exe? "Ingeborg" <a@b.invalid> wrote in message news:Xns99A4613302B27abinvalid@194.109.133.133... <snipped> > Who is talking about need? It should be fun. I have an old PC running W95 > without screen or keyboard in the basement. You can switch it on by > WakeOnLan, and I wrote a little program for it that pings a number of IP > addresses, and it shuts itself down when it feels alone. (One pitfall, I > had to turn off the 'Automatic daylight saving'. It will twice a year show > a messagebox that it changed the time, and I had to connect a monitor and > keyboard just to get that silly box away.) Re the above: I have activated Wake Up in BIOS: should that allow powering up W98 when it is down (when approached via the network on which it is located): it doesn't. Is it at all possible to make the W98 power-up via the network on which it resides? And if so, how should that be done from another box on that network? Many thanks, Adrian
Guest Ingeborg Posted September 8, 2007 Posted September 8, 2007 Re: What is the close_down.exe? Adrian wrote: > > "Ingeborg" <a@b.invalid> wrote in message > news:Xns99A4613302B27abinvalid@194.109.133.133... > <snipped> >> Who is talking about need? It should be fun. I have an old PC running >> W95 without screen or keyboard in the basement. You can switch it on >> by WakeOnLan, and I wrote a little program for it that pings a number >> of IP addresses, and it shuts itself down when it feels alone. (One >> pitfall, I had to turn off the 'Automatic daylight saving'. It will >> twice a year show a messagebox that it changed the time, and I had to >> connect a monitor and keyboard just to get that silly box away.) > > Re the above: I have activated Wake Up in BIOS: should that allow > powering up W98 when it is down (when approached via the network on > which it is located): it doesn't. Is it at all possible to make the > W98 power-up via the network on which it resides? And if so, how > should that be done from another box on that network? > I hope you mean WakeOnLan. It's a sevice supported by the BIOS, and both the motherboard and the NIC have to support it. In case of a seperate NIC a 2 wire line has to be connected between NIC and Mobo. See your mobo manual for details. To wake up a computer, you need a special program, which sends a special packet to the MAC address of the NIC. (Not to the IP address, since TCP/IP is a high level protocol, not provided by the BIOS). You can find lots of freeware programs for this. One of them: <http://gammadyne.com/cmdline.htm#wol> A note to your QBasic program: Did you realize that you should write the file before naming it? When your program does basically this: Create command.bat WriteTo command.bat Close command.bat it is possible that Win98Stop tries to execute the batch file between Create and WriteTo. What happens then is dependend of how QBasic opens the file, especially the sharing parameters. The safe way would be: Create command.tmp WriteTo command.tmp Close command.tmp Rename command.tmp command.bat
Recommended Posts