Rebooter, arrêter Windows 
Author Message
 Rebooter, arrêter Windows

How To restart or shutdown Windows (95, 98, NT 4) with wsh (ex : vbs)

Tks - Sylvain



Sun, 18 May 2003 03:00:00 GMT  
 Rebooter, arrêter Windows
Deja.com: Power Search
http://www.deja.com/home_ps.shtml

forum: microsoft.public.scripting.wsh
keyword: reboot

gives 300 hits...

--
Michael Harris
Microsoft.MVP.Scripting
--

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


Quote:
> How To restart or shutdown Windows (95, 98, NT 4) with wsh (ex : vbs)

> Tks - Sylvain



Sun, 18 May 2003 03:00:00 GMT  
 Rebooter, arrêter Windows
Is this FAQ getting to you, Michael?  

(I really do sympathize.  I get asked three times a week 'How do I name
a file/folder with the current date' using a batch file - my other
life.  I makes me see red. ;o)

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

Quote:

> Deja.com: Power Search
> http://www.deja.com/home_ps.shtml

> forum: microsoft.public.scripting.wsh
> keyword: reboot

> gives 300 hits...

> --
> Michael Harris
> Microsoft.MVP.Scripting
> --

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



> > How To restart or shutdown Windows (95, 98, NT 4) with wsh (ex :
> > vbs)

> > Tks - Sylvain



Sun, 18 May 2003 03:00:00 GMT  
 Rebooter, arrêter Windows
Ok, but when I try this code, I have got error
*****************************************************
Set wmi = WScript.CreateObject("WScript.Shell")
wmi = GetObject("winmgmts:{(Shutdown)}")
set objset = wmi.instancesof("win32_operatingsystem")
for each obj in objset
  set os = obj :  exit for
next
'os.shutdown
'os.reboot
Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Const EWX_POWEROFF = 8
***************************************************
Error : Nom du fichier ou de la classe introuvable lors de l'opration
Automation. 'GetObject'.

Please, Why ?
Tks



Quote:
> Deja.com: Power Search
> http://www.deja.com/home_ps.shtml

> forum: microsoft.public.scripting.wsh
> keyword: reboot

> gives 300 hits...

> --
> Michael Harris
> Microsoft.MVP.Scripting
> --

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



> > How To restart or shutdown Windows (95, 98, NT 4) with wsh (ex : vbs)

> > Tks - Sylvain



Mon, 19 May 2003 03:00:00 GMT  
 Rebooter, arrêter Windows
I don't speak (or read ;-) French, but I bet that translates (loosely) to "...invalid syntax..."
which simply means you don't have WMI (the wbemcore) installed...

WMI SDK (including wbemcore)
http://msdn.microsoft.com/downloads/sdks/wmi/download.asp

You don't need the SDK, just wbemcore...

--
Michael Harris
Microsoft.MVP.Scripting
--

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


Quote:
> Ok, but when I try this code, I have got error
> *****************************************************
> Set wmi = WScript.CreateObject("WScript.Shell")
> wmi = GetObject("winmgmts:{(Shutdown)}")
> set objset = wmi.instancesof("win32_operatingsystem")
> for each obj in objset
>   set os = obj :  exit for
> next
> 'os.shutdown
> 'os.reboot
> Const EWX_LOGOFF = 0
> Const EWX_SHUTDOWN = 1
> Const EWX_REBOOT = 2
> Const EWX_FORCE = 4
> Const EWX_POWEROFF = 8
> ***************************************************
> Error : Nom du fichier ou de la classe introuvable lors de l'opration
> Automation. 'GetObject'.

> Please, Why ?
> Tks



> > Deja.com: Power Search
> > http://www.deja.com/home_ps.shtml

> > forum: microsoft.public.scripting.wsh
> > keyword: reboot

> > gives 300 hits...

> > --
> > Michael Harris
> > Microsoft.MVP.Scripting
> > --

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



> > > How To restart or shutdown Windows (95, 98, NT 4) with wsh (ex : vbs)

> > > Tks - Sylvain



Mon, 19 May 2003 03:00:00 GMT  
 Rebooter, arrêter Windows
No, I download it.
thanks a lot
Sylvain


Quote:
> I don't speak (or read ;-) French, but I bet that translates (loosely) to

"...invalid syntax..."
Quote:
> which simply means you don't have WMI (the wbemcore) installed...

> WMI SDK (including wbemcore)
> http://msdn.microsoft.com/downloads/sdks/wmi/download.asp

> You don't need the SDK, just wbemcore...

> --
> Michael Harris
> Microsoft.MVP.Scripting
> --

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



> > Ok, but when I try this code, I have got error
> > *****************************************************
> > Set wmi = WScript.CreateObject("WScript.Shell")
> > wmi = GetObject("winmgmts:{(Shutdown)}")
> > set objset = wmi.instancesof("win32_operatingsystem")
> > for each obj in objset
> >   set os = obj :  exit for
> > next
> > 'os.shutdown
> > 'os.reboot
> > Const EWX_LOGOFF = 0
> > Const EWX_SHUTDOWN = 1
> > Const EWX_REBOOT = 2
> > Const EWX_FORCE = 4
> > Const EWX_POWEROFF = 8
> > ***************************************************
> > Error : Nom du fichier ou de la classe introuvable lors de l'opration
> > Automation. 'GetObject'.

> > Please, Why ?
> > Tks




> > > Deja.com: Power Search
> > > http://www.deja.com/home_ps.shtml

> > > forum: microsoft.public.scripting.wsh
> > > keyword: reboot

> > > gives 300 hits...

> > > --
> > > Michael Harris
> > > Microsoft.MVP.Scripting
> > > --

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



> > > > How To restart or shutdown Windows (95, 98, NT 4) with wsh (ex :
vbs)

> > > > Tks - Sylvain



Mon, 19 May 2003 03:00:00 GMT  
 Rebooter, arrêter Windows
Sorry, just for my curiosity : Why the message title in french and the body in english ?

Jean - JMST - Belgium (french speaking)



Mon, 19 May 2003 03:00:00 GMT  
 Rebooter, arrêter Windows

He manage to learn english just before writing the body text ??
(It's funny as a french speaking man to see that only frenchies are not
using english.. Out politicians call it "exception culturelle !"

Jean <Reply to the group please> a crit dans le message :

Quote:
> Sorry, just for my curiosity : Why the message title in french and the
body in english ?

> Jean - JMST - Belgium (french speaking)



Tue, 20 May 2003 03:00:00 GMT  
 Rebooter, arrêter Windows

Quote:


> > Ok, but when I try this code, I have got error
> > Error : Nom du fichier ou de la classe introuvable lors de
l'opration
> > Automation. 'GetObject'.
> I don't speak (or read ;-) French, but I bet that translates (loosely)

to "...invalid syntax..."

Quote:
> which simply means you don't have WMI (the wbemcore) installed...

This probably needs changing...

Set wmi = WScript.CreateObject("WScript.Shell")
wmi = GetObject("winmgmts:{(Shutdown)}")

to...

Set wmi = GetObject("winmgmts:{(Shutdown)}")

(Although the error appears to be "file or class name not found"!)
--
Robert Bradley

I am not a mindreader, so I don't know everything.



Sat, 24 May 2003 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Problems Installing Windows Script 5.0 and Windows Script Host 2.0 Beta on Windows NT 4.0

2. Windows Script 5.5 Beta 1 setup for Windows 2000 available

3. Windows 95 GDI or Windows printing system driver.

4. Windows scripting host - Checking a service in Windows NT 4

5. writing vbscript to know the OS of a remote PC ( is WIndows NT or WIndows 2000)

6. it's work with windows NT not with Windows 95

7. Windows Script 5.5 Beta 1 setup for Windows 2000 available

8. Need GS for Windows in order to use GSView for windows

9. Research: Windows Script Host or Windows Scripting Host

10. Windows Scripting Host on Windows 95 OSR2

11. Windows 98 clients with windows NT home directory

12. Windows 95 OSR1 and Windows Scripting Host

 

 
Powered by phpBB® Forum Software