Using a batch file to apply your BIOS date to Windows date.

Place to talk about all that new hardware and decaying software you have.

Moderator: General Mods

Post Reply
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Using a batch file to apply your BIOS date to Windows date.

Post by franpa »

@date /T > c:\folder
@date 7.3.2005

START "something" "C:\Program Files\something\something.exe"

@date < c:\folder
del c:\folder

EXIT
Is there any way to have a batch file restore your Windows Time to the time in your BIOS via batch file commands? if yes, then could you please let me know what commands and how to use them.

im not entirely sure exactly what the batch file above does but the end effect is my clock/date is set to 7.3.2005. My dad made a lot of batch files back in the day but doesn't remember ever using the @ symbol in anything.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
sweener2001
Inmate
Posts: 1751
Joined: Mon Dec 06, 2004 7:47 am
Location: WA

Post by sweener2001 »

can't you just go into the BIOS and change the time?
[img]http://i26.photobucket.com/albums/c128/sweener2001/StewieSIGPIC.png[/img]
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Re: Using a batch file to apply your BIOS date to Windows da

Post by Deathlike2 »

franpa wrote:
@date /T > c:\folder
@date 7.3.2005

START "something" "C:\Program Files\something\something.exe"

@date < c:\folder
del c:\folder

EXIT
Is there any way to have a batch file restore your Windows Time to the time in your BIOS via batch file commands? if yes, then could you please let me know what commands and how to use them.

im not entirely sure exactly what the batch file above does but the end effect is my clock/date is set to 7.3.2005. My dad made a lot of batch files back in the day but doesn't remember ever using the @ symbol in anything.
What this is trying to do is temporarily store the date to something (though, it should goto a text file or something easier). Once the app is closed, the date is reset to the current day. This method's only bug is if you run the app before midnight and close it after midnight.

This is basically something used for say those time-trial apps (to work around that annoying time-register-nag screen).

The @ symbol is to suppress that line from being seen when the batch file is executed.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
Gil_Hamilton
Buzzkill Gil
Posts: 4294
Joined: Wed Jan 12, 2005 7:14 pm

Post by Gil_Hamilton »

All the at sign does is suppress the printing of the line it's prefixed to.


You'd see it a lot in the old days. Usually in the form of "@echo off" on the first line. Which accomplishes what they're doing by @ing everything.
Only they fail to @ the START command, the DEL command, and the superfluous EXIT command.

And the reason it's always setting your date to 7.3.2005 is that the command "date 7.3.2005" sets the date to 7.3.2005


The BAT, as written, prints the current date to a file named "folder" in the root directory. It then sets the date to 7/3/05, runs a program, and when control is returned to the BAT, it feeds DATE the contents of c:\folder, deletes the "folder" file, then quits.

In theory, DATE < C:\Folder resets the date to that output by DATE /T > C:\folder. In practice, the date output to c:\folder is not the same format that the DATE command needs to be fed(it's prefixed with a weekday, at least in XP), so it fails.



Edit: Sniped by Deathlike. Though I've identified why it fails and he hasn't, so neener-neener-neener. :P
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

Gil_Hamilton wrote:Edit: Sniped by Deathlike. Though I've identified why it fails and he hasn't, so neener-neener-neener. :P
I didn't care.. the surprise would have been amusing. :wink:
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
odditude
Official tech support dood
Posts: 2118
Joined: Wed Jan 25, 2006 7:57 am

Re: Using a batch file to apply your BIOS date to Windows da

Post by odditude »

franpa wrote:

Code: Select all

@date /T > c:\folder
@date 7.3.2005

START "something" "C:\Program Files\something\something.exe"

@date < c:\folder
del c:\folder

EXIT
im not entirely sure exactly what the batch file above does...
Thou shalt learn the help command.

Code: Select all

C:\>date /?
Displays or sets the date.

DATE [/T | date]

Type DATE without parameters to display the current date setting and
a prompt for a new one.  Press ENTER to keep the same date.

If Command Extensions are enabled the DATE command supports
the /T switch which tells the command to just output the
current date, without prompting for a new date.
Therefore, line-by-line:

Code: Select all

@date /T > c:\folder
rem Saves the current date to a file called "c:\folder"
@date 7.3.2005
rem Sets the date to 7.3.2005

START "something" "C:\Program Files\something\something.exe"
rem Runs the program/command "something" from Explorer, with the argument "C:\Program Files\something\something.exe"

@date < c:\folder
rem Tries to set the date via the contents of "c:\folder"
del c:\folder
rem Deletes "c:\folder"

EXIT
rem Explicitly ends the batch call.
franpa wrote:Is there any way to have a batch file restore your Windows Time to the time in your BIOS via batch file commands?
No.

edit: damn, getting busy at work means everyone beats you to it.
Why yes, my shift key *IS* broken.
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Re: Using a batch file to apply your BIOS date to Windows da

Post by franpa »

odditude wrote:

Code: Select all

@date /T > c:\folder
rem Saves the current date to a file called "c:\folder"
@date 7.3.2005
rem Sets the date to 7.3.2005

START "something" "C:\Program Files\something\something.exe"
rem Runs the program/command "something" from Explorer, with the argument "C:\Program Files\something\something.exe"

@date < c:\folder
rem Tries to set the date via the contents of "c:\folder"
del c:\folder
rem Deletes "c:\folder"

EXIT
rem Explicitly ends the batch call.
Thanks everyone =) so there is no way to store and restore the current date via batch commands to achieve what i want?
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
Gil_Hamilton
Buzzkill Gil
Posts: 4294
Joined: Wed Jan 12, 2005 7:14 pm

Re: Using a batch file to apply your BIOS date to Windows da

Post by Gil_Hamilton »

franpa wrote:
odditude wrote:

Code: Select all

@date /T > c:\folder
rem Saves the current date to a file called "c:\folder"
@date 7.3.2005
rem Sets the date to 7.3.2005

START "something" "C:\Program Files\something\something.exe"
rem Runs the program/command "something" from Explorer, with the argument "C:\Program Files\something\something.exe"

@date < c:\folder
rem Tries to set the date via the contents of "c:\folder"
del c:\folder
rem Deletes "c:\folder"

EXIT
rem Explicitly ends the batch call.
Thanks everyone =) so there is no way to store and restore the current date via batch commands to achieve what i want?
Well... you could write a program to parse the DATE output and remove the leading weekday, and run that on the "folder" file before you do the "DATE < C:\folder" command. But it'd be more trouble than it's worth.
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

edit: is there a way to print the current time to a text file in the right format?
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Re: Using a batch file to apply your BIOS date to Windows da

Post by creaothceann »

Gil_Hamilton wrote:you could write a program
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
Kajuru
Regular
Posts: 253
Joined: Wed Oct 18, 2006 6:43 pm
Location: localhost

Re: Using a batch file to apply your BIOS date to Windows da

Post by Kajuru »

Code: Select all

@echo off
rem @date /T > c:\folder
date 7.3.2005

START "something" "C:\Program Files\something\something.exe"

rem @date < c:\folder
rem del c:\folder

w32tm /resync

rem EXIT

I think it should work, but I'm not using XP or Vista to actually test. You'll also probably need to be in the Admin group.
The idea is basically set the custom date, run the app, then sync it back using an atomic clock.
Rashidi
Trooper
Posts: 515
Joined: Fri Aug 18, 2006 2:45 pm

Post by Rashidi »

ah, this remind me of the old INT-21 from dos era... (2A - 2D)
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

@echo off
date 7.3.2005

START "something" "C:\Program Files\something\something.exe"

w32tm /resync

rem EXIT

C:\Program Files\Fruity Loops Studio 7>date 7.3.2005

C:\Program Files\Fruity Loops Studio 7>START "FLStudio" "C:\Program Files\Fruity
Loops Studio 7\FL.exe"

C:\Program Files\Fruity Loops Studio 7>w32tm /resync
Sending resync command to local computer...
The computer did not resync because the required time change was too big.


---
It does not succeed in syncing. i've setup windows clock to sync to time-b.nist.gov
Last edited by franpa on Thu Mar 27, 2008 7:20 am, edited 1 time in total.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
sweener2001
Inmate
Posts: 1751
Joined: Mon Dec 06, 2004 7:47 am
Location: WA

Post by sweener2001 »

just download a newer version. my cousin uses FL, and he can have the correct time, now.
[img]http://i26.photobucket.com/albums/c128/sweener2001/StewieSIGPIC.png[/img]
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

unless your talking about release candidates, there is no 'newer' version. i updated above ^ EDIT: can't find 8 anywhere ;)

EDIT: the windows clock can't resync unless your date matches the server... so it is only useful for syncing the time and not the date.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
funkyass
"God"
Posts: 1128
Joined: Tue Jul 27, 2004 11:24 pm

Post by funkyass »

abouttime

use it.
Does [Kevin] Smith masturbate with steel wool too?

- Yes, but don’t change the subject.
sweener2001
Inmate
Posts: 1751
Joined: Mon Dec 06, 2004 7:47 am
Location: WA

Post by sweener2001 »

franpa wrote:unless your talking about release candidates, there is no 'newer' version. i updated above ^ EDIT: can't find 8 anywhere ;)

EDIT: the windows clock can't resync unless your date matches the server... so it is only useful for syncing the time and not the date.
check your pms. it took me literally ten seconds.
[img]http://i26.photobucket.com/albums/c128/sweener2001/StewieSIGPIC.png[/img]
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

ya but that aint the final version.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
sweener2001
Inmate
Posts: 1751
Joined: Mon Dec 06, 2004 7:47 am
Location: WA

Post by sweener2001 »

cry about it. the final version released TWO days ago. this is as current as you're going to get for now.

at least you won't have to change your clock back and forth.

seriously. it's an RC, anyway. it's as good as final, just about.

what a tremendous waste of time this has been. you're trying to solve some stupid issue because you won't download an RC that FL feels is good enough to release to the public.
[img]http://i26.photobucket.com/albums/c128/sweener2001/StewieSIGPIC.png[/img]
Kajuru
Regular
Posts: 253
Joined: Wed Oct 18, 2006 6:43 pm
Location: localhost

Post by Kajuru »

sweener2001 wrote:what a tremendous waste of time this has been.
Everyone knew it from the start, It´s a...you know...franpa´s request
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

I wasn't crying about it, i was after a more feasible solution to the method needed for FL 7. i was pretty happy waiting for FL 8 Final. I was well aware that it takes normally a weak for stuff to appear online and was willing to wait.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
Post Reply