BAT to EXE
Prev Page Prev Page
ExeScript
What Is ExeScript?
Purchasing ExeScript
Registering ExeScript
Interface
Menus
Toolbar
Properties Pane
Resource View Pane
Customizing the Program View
Creating a New Script
Opening an Existing Script
Editing a Script
Saving a Script
Converting/Compiling a Script
Creating an EXE Application
How To
How to Convert Script to Exe
BAT to EXE
VBS to EXE
HTA to EXE
JS to EXE
ExeScript Host
Using ExeScript Host
ExeScript Host Object Model
ExeScript Host Language
Batch Commands
Tips for Writing Batch Files
Batch File Examples
VBS Files
Tips for Writing VBS Files
VBS File Examples
Licensing
Trial Versus Registered
Installing ExeScript
Uninstalling ExeScript
Copyrights

VBS File Examples

Message Box

Dim strMessage
strMessage = "Compile scripts into stand-alone applications"
MsgBox strMessage

Reboot

To reboot the local machine from a VBScript script, you can use the following code. For the code to work, Windows Management Instrumentation (WMI) must be installed on the machine you're rebooting.

Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")

for each OpSys in OpSysSet
    OpSys.Reboot()
next

To shut down the machine, change the OpSys.Reboot() line to OpSys.Shutdown().

Call Windows shutdown choice popup

set WshShell = wscript.CreateObject("Shell.Application")
WshShell.ShutdownWindows

See also:

Tips for Writing VBS Files

 

Copyright © ScriptCode.com 2014. All rights reserved.