Source language: Translate to:

Changing pc time

General questions about NeoBook

Moderator: Neosoft Support

Changing pc time

Postby carlos torres » Tue Sep 22, 2015 9:10 am

Hi everyone

Curiosity, it is possible to change the time on the computer by code?

regards
carlost
User avatar
carlos torres
 
Posts: 289
Joined: Mon May 02, 2005 8:14 am
Location: Pamplona, Colombia

Re: Changing pc time

Postby stu » Tue Sep 22, 2015 10:03 am

Yes sir, using vBScript

Syntax: [ Download ] [ Hide ]
Using Visual Basic Syntax Highlighting
dtmNewDateTime = "20071115132000.000000-480"
strComputer = "."
Set objWMIService = GetObject("winmgmts:{(Systemtime)}\\" & strComputer & "\root\cimv2")

Set colOSes = objWMIService.ExecQuery("Select * From Win32_OperatingSystem")

For Each objOS In colOSes
    objOS.SetDateTime dtmNewDateTime
Next
Parsed in 0.009 seconds, using GeSHi 1.0.8.10


btw, here's the Source with all the details ;)
Microsoft Access hater.
User avatar
stu
 
Posts: 318
Joined: Wed Aug 07, 2013 11:37 am

Re: Changing pc time

Postby carlos torres » Wed Sep 23, 2015 7:43 am

Thanks Stu
I will try your suggestion.

regards
carlost
User avatar
carlos torres
 
Posts: 289
Joined: Mon May 02, 2005 8:14 am
Location: Pamplona, Colombia

Re: Changing pc time

Postby CN_Iceman » Sun Sep 27, 2015 7:49 am

Another way...

Code: Select all
SetVar "[New_Time]" "15:30:00"
Run "Time" "[New_Time]" "RunOnce+Wait+LoadComplete+Minimized+Hidden" "" ""
Greetings/Saludos, Jose.
www.icemansoft.es
User avatar
CN_Iceman
 
Posts: 297
Joined: Tue Mar 01, 2011 11:04 am
Location: España


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 1 guest