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 |
|
|
IDL |
|
|
DLL |
|
Send comments about this topic to Microsoft
Build date: 3/7/2012
AutoIT Syntax (By Quantum)
$sObj= new-object -com shell.application
$toAutoIT=$sObj.settime()
$toAutoIT=$sObj.settime()
- 1/25/2011
- Kubilay Alkaç
- 2/9/2011
- Thomas Lee
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
- 6/30/2008
- Thomas Lee