restart windows 2000 using vbscript 
Author Message
 restart windows 2000 using vbscript

Hi,
  i would like to know the programmatic way to restart the windows 2000 m/c
using VBScript.
   or the command at the command prompt so that that can be used in a batch
file.

I found the Shell.Application object's shutdownWindows method. But it just
does the click of the shutdown button in the start menu.

any hints would be great..

Thanks
Geeta



Mon, 11 Oct 2004 04:02:45 GMT  
 restart windows 2000 using vbscript
There are a few ways.
(1) Get the pstools package from www.sysinternals.com; it's free and has a
command-line shutdown command you can use.

(2) You can use WMI:
Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//." _
 & "/root/cimv2").ExecQuery("select * " _
 & "from Win32_OperatingSystem where Primary=true")
for each OpSys in OpSysSet
 OpSys.Reboot()
next


Quote:
> Hi,
>   i would like to know the programmatic way to restart the windows 2000 m/c
> using vbscript.
>    or the command at the command prompt so that that can be used in a batch
> file.

> I found the Shell.Application object's shutdownWindows method. But it just
> does the click of the shutdown button in the start menu.

> any hints would be great..

> Thanks
> Geeta



Mon, 11 Oct 2004 04:28:05 GMT  
 restart windows 2000 using vbscript
i found the pstools option useful

Thank You
Geeta



Quote:
> There are a few ways.
> (1) Get the pstools package from www.sysinternals.com; it's free and has a
> command-line shutdown command you can use.

> (2) You can use WMI:
> Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//." _
>  & "/root/cimv2").ExecQuery("select * " _
>  & "from Win32_OperatingSystem where Primary=true")
> for each OpSys in OpSysSet
>  OpSys.Reboot()
> next



> > Hi,
> >   i would like to know the programmatic way to restart the windows 2000
m/c
> > using vbscript.
> >    or the command at the command prompt so that that can be used in a
batch
> > file.

> > I found the Shell.Application object's shutdownWindows method. But it
just
> > does the click of the shutdown button in the start menu.

> > any hints would be great..

> > Thanks
> > Geeta



Mon, 11 Oct 2004 09:06:42 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Windows 2000 Pro - Shutdown/Restart PC

2. Automatically restarting a Windows 2000 service

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

4. Win 2000 Pro Restart - Again??

5. Using gsprint on Windows 2000

6. Using GS fonts in Windows 2000 Applications

7. Unable to send faxes using Windows 2000 Faxing service

8. Modifying windows 2000 user accounts using VBS

9. Using SU.EXE utility in Windows 2000

10. Permission Denied in Windows 2000 using the RUN method

11. need help writing server monitor script for windows 2000 and win nt 4 using wsh

12. Using SU.EXE utility in Windows 2000

 

 
Powered by phpBB® Forum Software