Re: Change time by one hour
- From: "Pegasus \(MVP\)" <I.can@xxxxxxxxxx>
- Date: Fri, 7 Nov 2008 19:41:21 +0100
"Lost in Microbiology" <LostinMicrobiology@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote
in message news:3B146256-F133-4EC4-A6A2-4BECDCE97D8E@xxxxxxxxxxxxxxxx
"Pegasus (MVP)" wrote:
"Lost in Microbiology" <LostinMicrobiology@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote
in message news:A8E9F0D5-D4D0-4CB3-9A01-FB0747BEA20C@xxxxxxxxxxxxxxxx
Hello All,
I tried using the command prompt to change the time by one hour, but
couldn't quite get it to work. What I am looking to do is perform a
function
on the current system time. I have a remote computer that has a limited
user
account and can't change the clock. I want to create a batch file, burn
it
to
a disk and let them run that. What I was trying was to add 01:00:00 to
the
current time from the command prompt, but I think this is beyond my
abilities. Any help would be greatly appreciated.
You can get them to run this batch file:
@echo off
for /F "delims=:" %%a in ('echo %time%') do set /a hour=%%a + 1
for /F "tokens=2* delims=:" %%a in ('echo %time%') do set
NewTime=%hour%:%%a:%%b
echo Setting the time to %NewTime%
rem time %NewTime%
To test it, run it as it is. To activate it, remove the word "rem" in the
last line.
Note: Do not retype this batch file. Use copy & paste instead.
Thank you for the quick response. In testing I received the error 'New
Time'
is not recognized as an internal or external command, and the command
prompt
closes.
I just copied it and pasted into notepad, saved it as a .bat file, ALL
Files
under file type. Is this just operator error?
THanks
This happens because your newsreader broke up the batch file lines and you
did not "unbreak" them. Here is a line-numbered version of the same batch
file so that you can see clearly where each line starts:
1. @echo off
2. for /F "delims=:" %%a in ('echo %time%') do set /a hour=%%a + 1
3. for /F "tokens=2* delims=:" %%a in ('echo %time%') do set
NewTime=%hour%:%%a:%%b
4. echo Setting the time to %NewTime%
5. echo time %NewTime%
.
- References:
- Change time by one hour
- From: Lost in Microbiology
- Re: Change time by one hour
- From: Pegasus \(MVP\)
- Re: Change time by one hour
- From: Lost in Microbiology
- Change time by one hour
- Prev by Date: Sharing a Printer
- Next by Date: Re: Sharing a Printer
- Previous by thread: Re: Change time by one hour
- Next by thread: clean out Deleted files from HD
- Index(es):
Relevant Pages
|