This topic has not yet been rated - Rate this topic

Shell.SetTime method

Applies to: desktop apps only

Displays the Date and Time Properties dialog box. This method has the same effect as right-clicking the clock in the taskbar status area and selecting Adjust Date/Time.

Syntax

iRetVal = Shell.SetTime()

Parameters

This method has no parameters.

Examples

The following example shows SetTime in use. Proper usage is shown for JScript, VBScript, and Visual Basic.

JScript:


<script language="JScript">
    function fnShellSetTimeJ()
    {
        var objShell = new ActiveXObject("shell.application");
        
        objshell.SetTime();
    }
</script>


VBScript:

<script language="VBScript">
    function fnShellSetTimeVB()
        dim objShell
        
        set objShell = CreateObject("shell.application")
        objshell.SetTime
 
        set objShell = nothing
    end function
 </script>

Visual Basic:

Private Sub fnShellSetTimeVB()
    Dim objShell As Shell
    
    Set objShell = New Shell
    objshell.SetTime
 
    Set objShell = Nothing
End Sub

Requirements

Minimum supported client

Windows 2000 Professional, Windows XP

Minimum supported server

Windows 2000 Server

Header

Shldisp.h

IDL

Shldisp.idl

DLL

Shell32.dll (version 4.71 or later)

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
AutoIT Syntax (By Quantum)
$sObj= new-object -com shell.application
$toAutoIT=$sObj.settime()

SetTime sample using PowerShell
# set-time.ps1
# MSDN Sample to get help
# Thomas Lee - tfl@psp.co.uk

# First get shell object
$Shell = new-object -com Shell.Application

# Now get help
$shell.settime()

This sample produces no console output - it does bring up the Date/Time applet