General discussion

Locked

Scripting Time Zones

By DionHurst ·
I need to know how to handle Time Zones in Batch files. I have currently been using the soon command to schedule jobs on remote servers. Is there a way to do this in the near future across time zones using *.bat or *.cmd files and commands?

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Scripting Time Zones

by Curious_George In reply to Scripting Time Zones

You can do almost anything administratively using scripts, but you need to define your requirements in greater detail in order for me to respond properly.

Re-read your question and see if you can state your desired objective more clearly.

Explain what you want to do. Do you want to start a process (or bat job) on a remote system at a time other than the one local to your machines? Do you want to automatically configure scheduled jobs on all remote systems using only one master batch file to send out the commands to do so?
What do you mean "a way to do this in the near future?" Do you mean will Windows 2005 be able to do this? Be specific and I will try to help you.

Collapse -

Scripting Time Zones

by DionHurst In reply to Scripting Time Zones

I mean in the near future within 1-2min., but I can't handle Pacific times with the soon command. I have no problem adjusting for the CST & EST, but the soon command will not accept negative values. I schedule 65 sec. for CST (my timezone) & 3665sec for EST. This cannot be done with PST because the value would have to be negative for the soon command.

Collapse -

Scripting Time Zones

by DionHurst In reply to Scripting Time Zones

In the near future means using the "soon" command to schedule jobs. If there is a time zone difference the soon command will schedule the following day. I need to know if there is a way in *.cmd & *.bat files?

Collapse -

Scripting Time Zones

by Curious_George In reply to Scripting Time Zones

How about this:

@ECHO OFF
REM Extracts Current Time from your PC
FOR /F "Delims=: Tokens=1-2*" %%a in ('ECHO %TIME%') DO (
SET /A PSTHour=%%a-1
SET PSTMinute=%%b
)
REM Set the TIME on your PC to the same AS PST, Assuming you are 1 hour Ahead
TIME %PSTHour%:%PSTMinute%

REM Run your SOON command here:


REM Resets the TIME on your PC to the same as your domain controller.
NET TIME /SET /Y

Collapse -

Scripting Time Zones

by DionHurst In reply to Scripting Time Zones

Thanks for your assistance I will give this a try.

Collapse -

Scripting Time Zones

by DionHurst In reply to Scripting Time Zones

This question was closed by the author

Back to Windows Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums