Page 1 of 1 1
Topic Options
#9601 - 2001-06-15 09:37 PM Win95 Shutdown/Reboot
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I'm trying to do a shutdown/reboot at the end of my script but some of my Win95 clients return a script error. It worked on every computer I tested personally but when I put it in production, several users reported script errors. Can someone tell what I'm doing wrong?
;----------------------------------------------------------------------------------
$RC = MessageBox("PTF upgrade complete." + Chr(13) + "Computer will now REBOOT!","ShowCase PTF upgrade",16,60)
if @INWIN = 2 goto OS95REBOOT endif
$RC = Shutdown("", "System will REBOOT to enable new settings.", 30, 0, 1)
goto finish
:OS95REBOOT
RUN “RUNDLL32.EXE SHELL.DLL,RestartDialog”
SENDKEYS ({ENTER})
:finish


------------------
Laziness is the mother of invention

Les Ligetfalvy

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#9602 - 2001-06-15 10:15 PM Re: Win95 Shutdown/Reboot
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I'm no sendkeys() expert - but just to get the ball rolling ...

1) What kind of script "errors" are they reporting - any more details on that ?

2) There are "issues" with shutdown on 9x, here's an excerpt and workaround from the manual ...

quote:

The ShutDown function does not work reliably. This problem is caused by the underlying Windows API. It may be fixed in a future version of Windows 9x. As a workaround, try the following command :
SHELL “%windir%\RUNDLL32.EXE user.exe,ExitWindows”

3) Small thing, might want to enclose your SENDKEYS ({ENTER}) with quotes like this SENDKEYS ("{ENTER}")...

But I think the real thing is to determine what kind of error is happening ...

-Shawn

Top
#9603 - 2001-06-15 11:15 PM Re: Win95 Shutdown/Reboot
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Shawn,
Sorry to be vague. I got the info second hand from our HelpDesk. They don't know how to write down error messages, only that it flashed red on the KIX32 screen. This much I do know.

1. The users got the messagebox("PTF upgrade complete...
2. The RUN line generated the error in the KIX32 window. It did not bring up the restart dialog so it rules out sendkeys.

I don't know what machines this happened on. I have not ben able to reproduce the problem on the dozen or so machines I tested. The same sendkeys syntax is used elsewhere without problem. I've tried using shell but it doesn't work with sendkeys.
I think it may have to do with the environment path. Using env. variables like %windir% and %temp% does not always work as expected. It's left me scratching my head.
BTW, the script is called from the NT logon script KIXBAT1.BAT as follows:
%windir%\KIX32.EXE %0\..\SC3.KIX


------------------
Laziness is the mother of invention

Les Ligetfalvy

[This message has been edited by LLigetfa (edited 15 June 2001).]

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#9604 - 2001-06-15 11:49 PM Re: Win95 Shutdown/Reboot
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Hi Les,

This is the error I get when I run it on one of my Windows 95B systems.

code:
RUNDLL32 caused an invalid page fault in
module SHELL32.DLL at 0137:7fded0de.
Registers:
EAX=00000001 CS=0137 EIP=7fded0de EFLGS=00010282
EBX=0063fd40 SS=013f ESP=0063fd04 EBP=0063fd20
ECX=816671f7 DS=013f ESI=0000013f FS=1cc7
EDX=0001ad04 ES=013f EDI=8d3e2da7 GS=0000
Bytes at CS:EIP:
80 39 23 75 09 8d 41 01 8b 74 24 14 eb 11 8b 74
Stack dump:
8d3e2da7 0000013f 7fe1c16c 000002b8 816671f7 0000000a 31472d9f bff71a79 00008d60 0063ff68 bff7192e 8d3e2da7 00000000 233f8d3e 00000000 02020000

Microsoft has a KB article if these are Windows 98/ME but not Windows 95
http://support.microsoft.com/support/kb/articles/Q234/2/16.ASP?

NTDOC

Top
#9605 - 2001-06-16 12:30 AM Re: Win95 Shutdown/Reboot
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Les,

Kind of a scary program, but see my post here for another possible solution.

Program is FREEWARE
http://kixtart.org/board/Forum2/HTML/001817.html

NTDOC

Top
#9606 - 2001-06-20 11:28 PM Re: Win95 Shutdown/Reboot
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Thanks all for your input. The content between the quotes is not the problem, at least not on Win95 SR2.5c. The problem is in my own self admitted laziness. I cut and pasted the line from somewhere and it turns out the quotes are the curly variety. DUH! Do I feel stupid! Turns out it doesn't work for anyone, only nobody else complained.

------------------
Laziness is the mother of invention

Les Ligetfalvy

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

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 4873 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.161 seconds in which 0.117 seconds were spent on a total of 11 queries. Zlib compression enabled.

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