forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Set Windows Time?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Oct 16, 2002 9:17 pm    Post subject: Set Windows Time? Reply with quote

Is it possible to set the Windows time through VDS? Confused

Thanks... Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Oct 16, 2002 9:32 pm    Post subject: Reply with quote

You can use VDS and a DOS batch file in Win9x...
Code:

LIST CREATE, 1

rem -- Substitute whatever date/time ya want in this format --
LIST ADD, 1, "echo."@datetime(mm-dd-yyyy)"|date"
LIST ADD, 1, "echo."@datetime(h:nn:a/p)"|time"

LIST SAVEFILE, 1, c:\setdate.bat
RUNZ command /c c:\setdate.bat, WAIT

rem -- Check the new date/time --
INFO Date"   "@datetime(mm-dd-yyyy)@tab()@cr()@cr()Time"   "@datetime(hh:nn:am/pm)

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Oct 16, 2002 10:48 pm    Post subject: Reply with quote

Thanks for the idea, Mac. Very Happy

You can set the time directly from VDS by using DOS instead of a batch file.

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Oct 16, 2002 10:49 pm    Post subject: Reply with quote

Oops... Embarassed

That doesn't work...I will use the batch file instead... Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Oct 16, 2002 10:58 pm    Post subject: Reply with quote

Actually it does work straight from DOS. I use a
batch file to set one computer clock on my LAN,
so that's the reason I posted the batch example.

Just use these date/time formats:
Code:

RUNZ command /c "echo.02-02-2000|date"
RUNZ command /c "echo.2:30:p|time"

If anyone is curious how this works, it uses the same
DOS DATE and TIME commands that you use from
a DOS prompt to set the date and time.

The date/time (along with "echo." which serves as
an ENTER keystroke) is "piped" to the appropriate DOS
command (DATE or TIME) by using the "|" char.

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Oct 17, 2002 8:00 pm    Post subject: Reply with quote

Strange, it does not seem to work on my XP Computer. Confused
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Oct 17, 2002 8:34 pm    Post subject: Reply with quote

Well, I mentioned it works in Windows 9x... Confused

I think XP doesn't have true DOS, but rather a
DOS emulator.

Anyone else have an idea to set the time from VDS?

Also, has anyone tried to run the DOS command.com
under XP as a "DOS" program? Or would it crash?

Just a thought...

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Oct 17, 2002 9:29 pm    Post subject: Reply with quote

I just noticed that it did set the date though... (Feb. 2, 2000) Confused
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Oct 17, 2002 9:39 pm    Post subject: Reply with quote

Ya might check if your XP comp uses a different time
format, different separators (instead of the colons), etc.

If the DATE works, I'd think the TIME should too.

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
MarkTrubo
Contributor
Contributor


Joined: 27 May 2001
Posts: 148
Location: Long Island, NY

PostPosted: Thu Oct 17, 2002 11:00 pm    Post subject: Reply with quote

On XP I've used:

%%ATOMICITEM = @file(%Z\TIMEBLANK.sav,T)
%%DATEREAL = @DATETIME(mm-dd-yyyy,%%ATOMICITEM)

run command.com

:DOSCHECK
IF @WINEXISTS(#ConsoleWindowClass)
WINDOW SEND, #ConsoleWindowClass, "DATE "%%DATEREAL@CR()
WAIT 2
WINDOW SEND, #ConsoleWindowClass, "EXIT"@CR()
GOTO STEP4
END
WAIT 1
GOTO DOSCHECK

:STEP4

This can be done much better, but this format works on XP. The timeblank.sav is a file on our network server that gets it's time stamp updated to atomic time every few seconds.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Fri Oct 18, 2002 2:59 pm    Post subject: Reply with quote

I believe that NT based systems require you to have administrator rights in order to change the system time... don't know if that's a factor for you or not FreezingFire.
Back to top
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Oct 18, 2002 8:28 pm    Post subject: Reply with quote

Administrator priveliges are only required for setting the time if the Administrator has configured the computer that way. In my case, this is not an issue. Smile
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
attreus
Valued Newbie


Joined: 30 Jul 2002
Posts: 46
Location: Berlin/Germany

PostPosted: Mon Aug 18, 2003 10:31 pm    Post subject: ... years later ... maybe somebody's still interested ... Reply with quote

on xp or 2000 - systems you can use cmd.exe in a similar way that mac did with the dos-command.com

Code:

    runh @windir(s)\cmd /c time 04:07



don't know about older nt-versions.
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Tue Aug 19, 2003 3:14 am    Post subject: Reply with quote

SetSystemTime API would be probably the most reliable way. You can refer "run as" replacement API if you want to do it from a non admin account under NT/2k/XP.
Someone can write an example. It needs a structure i think.
Good Luck

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group