Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can I vbscript a system shutdown/restart?

1,291 views
Skip to first unread message

Wolf Family

unread,
Jun 30, 2000, 3:00:00 AM6/30/00
to
I want to create a vbscript or vb app to automatically shutdown and restart
my computer. I want to run this script or app at midnight everyweek (that I
can use the scheduler for). But my problem is I am running Windows 98. I
found an API call "InitiateSystemShutdown" but that only works for NT and
2000. I tried "ExitWindows" but that requires a user action for the logon
screen. This needs to be completely without user interaction.

If anyone can help I would greatly appreciate it.

Thank you,
wolfman

Warren Bell

unread,
Jun 30, 2000, 3:00:00 AM6/30/00
to
I have VBScript shutdown and restart scripts for win98 that I use. They
can be run from the scheduler. Copy this as shutdown.vbs:

'--------------------------------------------------
' Shutdown script
'--------------------------------------------------
set WshShell = CreateObject("WScript.Shell")

WshShell.run "C:\WINDOWS\RUNDLL.EXE user.exe,exitwindows", 0, false

WScript.quit


For restart replace exitwindows with exitwindowsexec.

Bill James

unread,
Jun 30, 2000, 3:00:00 AM6/30/00
to
Shutdown:

set ws = WScript.CreateObject("WScript.shell")
ws.run "rundll32 shell32.dll,SHExitWindowsEx 1"

Reboot:

set ws = WScript.CreateObject("WScript.shell")
ws.run "rundll32 shell32.dll,SHExitWindowsEx 2"

Logoff User:

set ws = WScript.CreateObject("WScript.shell")
ws.run "rundll32 shell32.dll,SHExitWindowsEx 0"

--

Bill James
Microsoft MVP·DTS

»Free Win9x VBScript Utilities«
»»New Address - Change your links!««
http://www.svvi.net/wgjames/vbspage/

"Wolf Family" <wolff...@bigfoot.com> wrote in message news:#2UGKgw4$GA....@cppssbbsa02.microsoft.com...

Wolf Family

unread,
Jul 1, 2000, 3:00:00 AM7/1/00
to
Thank you very much!!!

wolfman

"Warren Bell" <wjb...@table.jps.net> wrote in message
news:395D680A...@table.jps.net...


> I have VBScript shutdown and restart scripts for win98 that I use. They
> can be run from the scheduler. Copy this as shutdown.vbs:
>
> '--------------------------------------------------
> ' Shutdown script
> '--------------------------------------------------
> set WshShell = CreateObject("WScript.Shell")
>
> WshShell.run "C:\WINDOWS\RUNDLL.EXE user.exe,exitwindows", 0, false
>
> WScript.quit
>
>
> For restart replace exitwindows with exitwindowsexec.
>
>
> Wolf Family wrote:
> >

Wolf Family

unread,
Jul 1, 2000, 3:00:00 AM7/1/00
to
Thank you very much!!!

wolfman

"Bill James" <wgj...@mvps.org> wrote in message
news:e3bf2Bx4$GA.836@cpmsftngp03...
Shutdown:

set ws = WScript.CreateObject("WScript.shell")
ws.run "rundll32 shell32.dll,SHExitWindowsEx 1"

Reboot:

set ws = WScript.CreateObject("WScript.shell")
ws.run "rundll32 shell32.dll,SHExitWindowsEx 2"

Logoff User:

set ws = WScript.CreateObject("WScript.shell")
ws.run "rundll32 shell32.dll,SHExitWindowsEx 0"

--

Bill James
Microsoft MVP·DTS

»Free Win9x VBScript Utilities«
»»New Address - Change your links!««
http://www.svvi.net/wgjames/vbspage/

"Wolf Family" <wolff...@bigfoot.com> wrote in message
news:#2UGKgw4$GA....@cppssbbsa02.microsoft.com...

0 new messages