Shutdown within WSH 
Author Message
 Shutdown within WSH

I read the FAQ's and one mentioned shutting down Windows by using:

  objshell = wscript.createobject( "shell.application" )

  objshell.shutdownwindows

Ok I did this and I get an error on the createobject step.  The error is:

  "Could not locate automation class named "Shell.Application".

What did I miss?

Thanks
Alan



Sat, 19 Jul 2003 02:05:06 GMT  
 Shutdown within WSH

Quote:

> I read the FAQ's and one mentioned shutting down Windows by using:

>   objshell = wscript.createobject( "shell.application" )

>   objshell.shutdownwindows

> Ok I did this and I get an error on the createobject step.  The error
> is:

>   "Could not locate automation class named "Shell.Application".

> What did I miss?

> Thanks
> Alan

What OS.  You need a version that has shell32.dll version 4.71 or
later.  For more information see (all on one line):

http://msdn.microsoft.com/library/psdk/shellcc/Shell/objects/Shell/
Application.htm

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/



Sat, 19 Jul 2003 02:42:07 GMT  
 Shutdown within WSH
I do have IE 5.5 so I should have the correct Shell32.dll.  I am running Win 95
Version 4.00.950 B.

Alan

Quote:
-----Original Message-----

> I read the FAQ's and one mentioned shutting down Windows by using:

>   objshell = wscript.createobject( "shell.application" )

>   objshell.shutdownwindows

> Ok I did this and I get an error on the createobject step.  The error
> is:

>   "Could not locate automation class named "Shell.Application".

> What did I miss?

> Thanks
> Alan

What OS.  You need a version that has shell32.dll version 4.71 or
later.  For more information see (all on one line):

http://msdn.microsoft.com/library/psdk/shellcc/Shell/objects/Shell/
Application.htm

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/
.



Sat, 19 Jul 2003 03:04:46 GMT  
 Shutdown within WSH
IE5.5 doesn't update shell32.dll.  Even then, this method only brings up the standard shutdown
dialog box.  There are other ways to automate shutting down Windows.  The cleanest is using WMI
(which *can* be installed on Win95).  There are also ways using rundll32.exe that have been posted
in the past.  The exact syntax varies based on the version of Window.

The following is an excerpt from a previous post by Tom Lavedas...

=====================================================
Windows 98:

Closes all programs and prompts you to log on:
  rundll32.exe shell32.dll,SHExitWindowsEx

To cause a complete system reboot, use the command line:
  rundll32.exe shell32.dll,SHExitWindowsEx 2

This powers down the system on laptops and systems equipped with ATX
power supplies:
  rundll32.exe shell32.dll,SHExitWindowsEx 5

Reference URL for preceding items:
http://www.zdnet.com/pcmag/pctech/content/solutions/oe1804a.htm

From other sources for Win 9x:

  rundll32.exe User.exe,ExitWindowsExec 5        % restarts %
  rundll32.exe User.exe,ExitWindows              % shuts down %

Also a reboot for Win 9x:
Ref: microsoft.public.scripting.VBScript, "Mark L. Ferguson"

  rundll.exe user.exe, ExitWindowsExec EW_REBOOTSYSTEM , 0

In all cases, the text after the comma is case sensitive!

Tom Lavedas
===========================================================

But there are plenty of other reason to get this shell upgrade.

Version 4.71 of shell32.dll is installed by the optional IE4 "Desktop Update" that adds Active
Desktop features.

Officially, adding Active Desktop after the fact is documented at:

How to Add or Remove Windows Desktop Update
http://support.microsoft.com/support/kb/articles/q165/6/95.asp

Unofficially, there are numerous newsgroup posts from various sources on how to avoid
uninstall/reinstall.  This one in particular was posted by Mark Ferguson (MVP-DTS)...

From the folder that contains ie5setup.exe.

Win9x: ie5setup.exe /c:"ie5wzd /e:IE4Shell_WIN /I:Y"
WinNT: ie5setup.exe /c:"ie5wzd /e:IE4Shell_NTx86 /I:Y"

Reinstall the browser only, and/or use the IE5 repair afterwards, to fix any later problems.

I should note that it is 1) an unofficial and 2) unsupported method of upgrading the shell, so use
this at your own risk!!!  Lots of people have posted that they have used this technique
successfully.

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--


I do have IE 5.5 so I should have the correct Shell32.dll.  I am running Win 95
Version 4.00.950 B.

Alan

Quote:
-----Original Message-----

> I read the FAQ's and one mentioned shutting down Windows by using:

>   objshell = wscript.createobject( "shell.application" )

>   objshell.shutdownwindows

> Ok I did this and I get an error on the createobject step.  The error
> is:

>   "Could not locate automation class named "Shell.Application".

> What did I miss?

> Thanks
> Alan

What OS.  You need a version that has shell32.dll version 4.71 or
later.  For more information see (all on one line):

http://msdn.microsoft.com/library/psdk/shellcc/Shell/objects/Shell/
Application.htm

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/
.



Sat, 19 Jul 2003 10:36:33 GMT  
 Shutdown within WSH
I want to thank you for this posting it was very extremely helpfull.  Thanks

Alan Ayers

Quote:
-----Original Message-----
IE5.5 doesn't update shell32.dll.  Even then, this method only brings up the
standard shutdown
dialog box.  There are other ways to automate shutting down Windows.  The
cleanest is using WMI
(which *can* be installed on Win95).  There are also ways using rundll32.exe that
have been posted
in the past.  The exact syntax varies based on the version of Window.

The following is an excerpt from a previous post by Tom Lavedas...

=====================================================
Windows 98:

Closes all programs and prompts you to log on:
  rundll32.exe shell32.dll,SHExitWindowsEx

To cause a complete system reboot, use the command line:
  rundll32.exe shell32.dll,SHExitWindowsEx 2

This powers down the system on laptops and systems equipped with ATX
power supplies:
  rundll32.exe shell32.dll,SHExitWindowsEx 5

Reference URL for preceding items:
http://www.zdnet.com/pcmag/pctech/content/solutions/oe1804a.htm

From other sources for Win 9x:

  rundll32.exe User.exe,ExitWindowsExec 5        % restarts %
  rundll32.exe User.exe,ExitWindows              % shuts down %

Also a reboot for Win 9x:
Ref: microsoft.public.scripting.vbscript, "Mark L. Ferguson"

  rundll.exe user.exe, ExitWindowsExec EW_REBOOTSYSTEM , 0

In all cases, the text after the comma is case sensitive!

Tom Lavedas
===========================================================

But there are plenty of other reason to get this shell upgrade.

Version 4.71 of shell32.dll is installed by the optional IE4 "Desktop Update"
that adds Active
Desktop features.

Officially, adding Active Desktop after the fact is documented at:

How to Add or Remove Windows Desktop Update
http://support.microsoft.com/support/kb/articles/q165/6/95.asp

Unofficially, there are numerous newsgroup posts from various sources on how to
avoid
uninstall/reinstall.  This one in particular was posted by Mark Ferguson (MVP-
DTS)...

From the folder that contains ie5setup.exe.

Win9x: ie5setup.exe /c:"ie5wzd /e:IE4Shell_WIN /I:Y"
WinNT: ie5setup.exe /c:"ie5wzd /e:IE4Shell_NTx86 /I:Y"

Reinstall the browser only, and/or use the IE5 repair afterwards, to fix any
later problems.

I should note that it is 1) an unofficial and 2) unsupported method of upgrading
the shell, so use
this at your own risk!!!  Lots of people have posted that they have used this
technique
successfully.

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--



I do have IE 5.5 so I should have the correct Shell32.dll.  I am running Win 95
Version 4.00.950 B.

Alan

-----Original Message-----

> I read the FAQ's and one mentioned shutting down Windows by using:

>   objshell = wscript.createobject( "shell.application" )

>   objshell.shutdownwindows

> Ok I did this and I get an error on the createobject step.  The error
> is:

>   "Could not locate automation class named "Shell.Application".

> What did I miss?

> Thanks
> Alan

What OS.  You need a version that has shell32.dll version 4.71 or
later.  For more information see (all on one line):

http://msdn.microsoft.com/library/psdk/shellcc/Shell/objects/Shell/
Application.htm

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/
..

.



Sat, 19 Jul 2003 21:43:02 GMT  
 Shutdown within WSH
Ok I tried this

        set wsh = createobject("WScript.Shell")
        Wsh.Run ("rundll32.exe user.exe, ExitWindowsExec 5")

I then get an error saying "Error in User.EXE Missing Entry"  Why would I get
this?

Alan

Quote:
-----Original Message-----

IE5.5 doesn't update shell32.dll.  Even then, this method only brings up the
standard shutdown
dialog box.  There are other ways to automate shutting down Windows.  The
cleanest is using WMI
(which *can* be installed on Win95).  There are also ways using rundll32.exe that
have been posted
in the past.  The exact syntax varies based on the version of Window.

The following is an excerpt from a previous post by Tom Lavedas...

=====================================================
Windows 98:

Closes all programs and prompts you to log on:
  rundll32.exe shell32.dll,SHExitWindowsEx

To cause a complete system reboot, use the command line:
  rundll32.exe shell32.dll,SHExitWindowsEx 2

This powers down the system on laptops and systems equipped with ATX
power supplies:
  rundll32.exe shell32.dll,SHExitWindowsEx 5

Reference URL for preceding items:
http://www.zdnet.com/pcmag/pctech/content/solutions/oe1804a.htm

From other sources for Win 9x:

  rundll32.exe User.exe,ExitWindowsExec 5        % restarts %
  rundll32.exe User.exe,ExitWindows              % shuts down %

Also a reboot for Win 9x:
Ref: microsoft.public.scripting.vbscript, "Mark L. Ferguson"

  rundll.exe user.exe, ExitWindowsExec EW_REBOOTSYSTEM , 0

In all cases, the text after the comma is case sensitive!

Tom Lavedas
===========================================================

But there are plenty of other reason to get this shell upgrade.

Version 4.71 of shell32.dll is installed by the optional IE4 "Desktop Update"
that adds Active
Desktop features.

Officially, adding Active Desktop after the fact is documented at:

How to Add or Remove Windows Desktop Update
http://support.microsoft.com/support/kb/articles/q165/6/95.asp

Unofficially, there are numerous newsgroup posts from various sources on how to
avoid
uninstall/reinstall.  This one in particular was posted by Mark Ferguson (MVP-
DTS)...

From the folder that contains ie5setup.exe.

Win9x: ie5setup.exe /c:"ie5wzd /e:IE4Shell_WIN /I:Y"
WinNT: ie5setup.exe /c:"ie5wzd /e:IE4Shell_NTx86 /I:Y"

Reinstall the browser only, and/or use the IE5 repair afterwards, to fix any
later problems.

I should note that it is 1) an unofficial and 2) unsupported method of upgrading
the shell, so use
this at your own risk!!!  Lots of people have posted that they have used this
technique
successfully.

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--



I do have IE 5.5 so I should have the correct Shell32.dll.  I am running Win 95
Version 4.00.950 B.

Alan

-----Original Message-----

> I read the FAQ's and one mentioned shutting down Windows by using:

>   objshell = wscript.createobject( "shell.application" )

>   objshell.shutdownwindows

> Ok I did this and I get an error on the createobject step.  The error
> is:

>   "Could not locate automation class named "Shell.Application".

> What did I miss?

> Thanks
> Alan

What OS.  You need a version that has shell32.dll version 4.71 or
later.  For more information see (all on one line):

http://msdn.microsoft.com/library/psdk/shellcc/Shell/objects/Shell/
Application.htm

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/
..

.



Sat, 19 Jul 2003 21:51:33 GMT  
 Shutdown within WSH
Tried the WMI method and it says it cannot find the file.  I tried finding
information about this and could not can you help here too?  Thanks

"File name or class name not found during automation operatoin: 'GetObject'"

Set oShutdown = GetObject("winmgmts:{impersonationlevel=impersonate,
(shutdown)}").Execquery("Select * From win32_operatingsystem")

Alan

Quote:
-----Original Message-----

IE5.5 doesn't update shell32.dll.  Even then, this method only brings up the
standard shutdown
dialog box.  There are other ways to automate shutting down Windows.  The
cleanest is using WMI
(which *can* be installed on Win95).  There are also ways using rundll32.exe that
have been posted
in the past.  The exact syntax varies based on the version of Window.

The following is an excerpt from a previous post by Tom Lavedas...

=====================================================
Windows 98:

Closes all programs and prompts you to log on:
  rundll32.exe shell32.dll,SHExitWindowsEx

To cause a complete system reboot, use the command line:
  rundll32.exe shell32.dll,SHExitWindowsEx 2

This powers down the system on laptops and systems equipped with ATX
power supplies:
  rundll32.exe shell32.dll,SHExitWindowsEx 5

Reference URL for preceding items:
http://www.zdnet.com/pcmag/pctech/content/solutions/oe1804a.htm

From other sources for Win 9x:

  rundll32.exe User.exe,ExitWindowsExec 5        % restarts %
  rundll32.exe User.exe,ExitWindows              % shuts down %

Also a reboot for Win 9x:
Ref: microsoft.public.scripting.vbscript, "Mark L. Ferguson"

  rundll.exe user.exe, ExitWindowsExec EW_REBOOTSYSTEM , 0

In all cases, the text after the comma is case sensitive!

Tom Lavedas
===========================================================

But there are plenty of other reason to get this shell upgrade.

Version 4.71 of shell32.dll is installed by the optional IE4 "Desktop Update"
that adds Active
Desktop features.

Officially, adding Active Desktop after the fact is documented at:

How to Add or Remove Windows Desktop Update
http://support.microsoft.com/support/kb/articles/q165/6/95.asp

Unofficially, there are numerous newsgroup posts from various sources on how to
avoid
uninstall/reinstall.  This one in particular was posted by Mark Ferguson (MVP-
DTS)...

From the folder that contains ie5setup.exe.

Win9x: ie5setup.exe /c:"ie5wzd /e:IE4Shell_WIN /I:Y"
WinNT: ie5setup.exe /c:"ie5wzd /e:IE4Shell_NTx86 /I:Y"

Reinstall the browser only, and/or use the IE5 repair afterwards, to fix any
later problems.

I should note that it is 1) an unofficial and 2) unsupported method of upgrading
the shell, so use
this at your own risk!!!  Lots of people have posted that they have used this
technique
successfully.

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--



I do have IE 5.5 so I should have the correct Shell32.dll.  I am running Win 95
Version 4.00.950 B.

Alan

-----Original Message-----

> I read the FAQ's and one mentioned shutting down Windows by using:

>   objshell = wscript.createobject( "shell.application" )

>   objshell.shutdownwindows

> Ok I did this and I get an error on the createobject step.  The error
> is:

>   "Could not locate automation class named "Shell.Application".

> What did I miss?

> Thanks
> Alan

What OS.  You need a version that has shell32.dll version 4.71 or
later.  For more information see (all on one line):

http://msdn.microsoft.com/library/psdk/shellcc/Shell/objects/Shell/
Application.htm

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/
..

.



Sat, 19 Jul 2003 23:01:06 GMT  
 Shutdown within WSH
Ok sorry about the last question on WMI I managed to find how to get it installed
on Win95.  I apologize.  I am still wondering why the "user.exe, ExitWindowsExec
5" does not work cause with neither the updated Shell32.dll or installing WMI on
the end users system  I should be able to use this to shut down any 9x system or
NT system without updates first right?

Thanks again you have been a tremedous help

Alan

Quote:
" -----Original Message-----

IE5.5 doesn't update shell32.dll.  Even then, this method only brings up the
standard shutdown
dialog box.  There are other ways to automate shutting down Windows.  The
cleanest is using WMI
(which *can* be installed on Win95).  There are also ways using rundll32.exe that
have been posted
in the past.  The exact syntax varies based on the version of Window.

The following is an excerpt from a previous post by Tom Lavedas...

=====================================================
Windows 98:

Closes all programs and prompts you to log on:
  rundll32.exe shell32.dll,SHExitWindowsEx

To cause a complete system reboot, use the command line:
  rundll32.exe shell32.dll,SHExitWindowsEx 2

This powers down the system on laptops and systems equipped with ATX
power supplies:
  rundll32.exe shell32.dll,SHExitWindowsEx 5

Reference URL for preceding items:
http://www.zdnet.com/pcmag/pctech/content/solutions/oe1804a.htm

From other sources for Win 9x:

  rundll32.exe User.exe,ExitWindowsExec 5        % restarts %
  rundll32.exe User.exe,ExitWindows              % shuts down %

Also a reboot for Win 9x:
Ref: microsoft.public.scripting.vbscript, "Mark L. Ferguson"

  rundll.exe user.exe, ExitWindowsExec EW_REBOOTSYSTEM , 0

In all cases, the text after the comma is case sensitive!

Tom Lavedas
===========================================================

But there are plenty of other reason to get this shell upgrade.

Version 4.71 of shell32.dll is installed by the optional IE4 "Desktop Update"
that adds Active
Desktop features.

Officially, adding Active Desktop after the fact is documented at:

How to Add or Remove Windows Desktop Update
http://support.microsoft.com/support/kb/articles/q165/6/95.asp

Unofficially, there are numerous newsgroup posts from various sources on how to
avoid
uninstall/reinstall.  This one in particular was posted by Mark Ferguson (MVP-
DTS)...

From the folder that contains ie5setup.exe.

Win9x: ie5setup.exe /c:"ie5wzd /e:IE4Shell_WIN /I:Y"
WinNT: ie5setup.exe /c:"ie5wzd /e:IE4Shell_NTx86 /I:Y"

Reinstall the browser only, and/or use the IE5 repair afterwards, to fix any
later problems.

I should note that it is 1) an unofficial and 2) unsupported method of upgrading
the shell, so use
this at your own risk!!!  Lots of people have posted that they have used this
technique
successfully.

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--



I do have IE 5.5 so I should have the correct Shell32.dll.  I am running Win 95
Version 4.00.950 B.

Alan

-----Original Message-----

> I read the FAQ's and one mentioned shutting down Windows by using:

>   objshell = wscript.createobject( "shell.application" )

>   objshell.shutdownwindows

> Ok I did this and I get an error on the createobject step.  The error
> is:

>   "Could not locate automation class named "Shell.Application".

> What did I miss?

> Thanks
> Alan

What OS.  You need a version that has shell32.dll version 4.71 or
later.  For more information see (all on one line):

http://msdn.microsoft.com/library/psdk/shellcc/Shell/objects/Shell/
Application.htm

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/
..

.



Sat, 19 Jul 2003 23:30:48 GMT  
 Shutdown within WSH
You could try some of the suggestions here...

Batch files - RUNDLL
http://www.robvanderwoude.com/rundll.html

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--


Ok sorry about the last question on WMI I managed to find how to get it installed
on Win95.  I apologize.  I am still wondering why the "user.exe, ExitWindowsExec
5" does not work cause with neither the updated Shell32.dll or installing WMI on
the end users system  I should be able to use this to shut down any 9x system or
NT system without updates first right?

Thanks again you have been a tremedous help

Alan

Quote:
" -----Original Message-----

IE5.5 doesn't update shell32.dll.  Even then, this method only brings up the
standard shutdown
dialog box.  There are other ways to automate shutting down Windows.  The
cleanest is using WMI
(which *can* be installed on Win95).  There are also ways using rundll32.exe that
have been posted
in the past.  The exact syntax varies based on the version of Window.

The following is an excerpt from a previous post by Tom Lavedas...

=====================================================
Windows 98:

Closes all programs and prompts you to log on:
  rundll32.exe shell32.dll,SHExitWindowsEx

To cause a complete system reboot, use the command line:
  rundll32.exe shell32.dll,SHExitWindowsEx 2

This powers down the system on laptops and systems equipped with ATX
power supplies:
  rundll32.exe shell32.dll,SHExitWindowsEx 5

Reference URL for preceding items:
http://www.zdnet.com/pcmag/pctech/content/solutions/oe1804a.htm

From other sources for Win 9x:

  rundll32.exe User.exe,ExitWindowsExec 5        % restarts %
  rundll32.exe User.exe,ExitWindows              % shuts down %

Also a reboot for Win 9x:
Ref: microsoft.public.scripting.vbscript, "Mark L. Ferguson"

  rundll.exe user.exe, ExitWindowsExec EW_REBOOTSYSTEM , 0

In all cases, the text after the comma is case sensitive!

Tom Lavedas
===========================================================

But there are plenty of other reason to get this shell upgrade.

Version 4.71 of shell32.dll is installed by the optional IE4 "Desktop Update"
that adds Active
Desktop features.

Officially, adding Active Desktop after the fact is documented at:

How to Add or Remove Windows Desktop Update
http://support.microsoft.com/support/kb/articles/q165/6/95.asp

Unofficially, there are numerous newsgroup posts from various sources on how to
avoid
uninstall/reinstall.  This one in particular was posted by Mark Ferguson (MVP-
DTS)...

From the folder that contains ie5setup.exe.

Win9x: ie5setup.exe /c:"ie5wzd /e:IE4Shell_WIN /I:Y"
WinNT: ie5setup.exe /c:"ie5wzd /e:IE4Shell_NTx86 /I:Y"

Reinstall the browser only, and/or use the IE5 repair afterwards, to fix any
later problems.

I should note that it is 1) an unofficial and 2) unsupported method of upgrading
the shell, so use
this at your own risk!!!  Lots of people have posted that they have used this
technique
successfully.

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--



I do have IE 5.5 so I should have the correct Shell32.dll.  I am running Win 95
Version 4.00.950 B.

Alan

-----Original Message-----

> I read the FAQ's and one mentioned shutting down Windows by using:

>   objshell = wscript.createobject( "shell.application" )

>   objshell.shutdownwindows

> Ok I did this and I get an error on the createobject step.  The error
> is:

>   "Could not locate automation class named "Shell.Application".

> What did I miss?

> Thanks
> Alan

What OS.  You need a version that has shell32.dll version 4.71 or
later.  For more information see (all on one line):

http://msdn.microsoft.com/library/psdk/shellcc/Shell/objects/Shell/
Application.htm

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/
..

.



Sun, 20 Jul 2003 09:18:36 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Rerun a program automatically in wsh if it dies or is shutdown

2. Shutdown using WSH??

3. Unable to Shutdown Windows95 & reboot via WSH

4. Can I shutdown computer with WSH?

5. Rerun a program automatically in wsh if it dies or is shutdown

6. How to shutdown the computer with WSH

7. Remote shutdown using wsh

8. Shutting down NT from within WSH

9. The error on WSH within ASP programming!

10. wsh embeded within html

11. Create E-mail within WSH

12. Using WSH Network objects within IE

 

 
Powered by phpBB® Forum Software