How to schedule an automatic shutdown (II)

  • Thread starter Thread starter AdiT
  • Start date Start date
A

AdiT

Dave,

I'm sorry to bother you again ...
I tried to run your VB script but I've got this
compilation error: Expected statement Line 2 Char 5 Code
800A0400.

I'm not familiar with VB so if you can please give me an
idea how to solve it.

Thanks in advance,
Adi
 
It's probably a linewrap issue. Try this one. If you post in the same
thread, it will make it easier to follow.

Set colOperatingSystems = GetObject _
("winmgmts:{(Shutdown)}").ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(1)
Next
 
Dave,
you was right about linewarp issue. The script is running
now ... but is doing a shutdown like for an AT power
source (will display that message "It's now safe to power
off ...") instead to make a total power off (my PC has a
ATX power source)

Is the script doing the right thing ?

Thanks again,
Adi
PS: sorry about the thread ... I'll use only this one (the
2nd) from here on.
***********************
-----Original Message-----
It's probably a linewrap issue. Try this one. If you post in the same
thread, it will make it easier to follow.

Set colOperatingSystems = GetObject _
("winmgmts:{(Shutdown)}").ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(1)
Next

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft MVP [Windows NT/2000 Operating Systems]

AdiT said:
Dave,

I'm sorry to bother you again ...
I tried to run your VB script but I've got this
compilation error: Expected statement Line 2 Char 5 Code
800A0400.

I'm not familiar with VB so if you can please give me an
idea how to solve it.

Thanks in advance,
Adi


.
 
Sorry, that should have been;

Set colOperatingSystems = GetObject _
("winmgmts:{(Shutdown)}").ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(8)
Next
 
Adit,

You can find a tool in Windows NT Resource KIT, by
name "shutdown.exe" which also works on 2000. Just
schedule the same with options, like to send a message or
to reboot after shutdown, etc etc and it will do the job
for you,

Just in case you don't have the Resource KIT CD with you,
you can download the same in
http://www.dynawell.com/reskit/microsoft/win2000/shutdown.z
ip

Good Luck,
Thanks and Regards
Nishanth
-----Original Message-----
It's probably a linewrap issue. Try this one. If you post in the same
thread, it will make it easier to follow.

Set colOperatingSystems = GetObject _
("winmgmts:{(Shutdown)}").ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(1)
Next

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft MVP [Windows NT/2000 Operating Systems]

AdiT said:
Dave,

I'm sorry to bother you again ...
I tried to run your VB script but I've got this
compilation error: Expected statement Line 2 Char 5 Code
800A0400.

I'm not familiar with VB so if you can please give me an
idea how to solve it.

Thanks in advance,
Adi


.
 
Hi Dave and Nishanth,

Dave, this time was just perfect. Many thanks again. By
the way ,where can I find some tutorials to learn how make
this kind of system scripts ?

Nishanth, I tried your link but is unavailable for me. If
you can, just forward that zip to my email address.

Regards,
Adi
********************
********************
 
Back
Top