Is it possible to synchronise the time of the local machine via VBS -
like the command "NET TIME \\SERVER /SET /Y"

Cheers.
Danny

Re: Set the time?? by Charles

Charles
Wed Apr 28 17:17:13 CDT 2004

Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.Run ("%comspec% /c NET TIME \\SERVER /SET /Y"), 0, False

Charles

"dude" <dude@dude.com> wrote in message
news:7s3u80laqu8hi1dl3vdb52595ffvb8mvdf@4ax.com...
> Is it possible to synchronise the time of the local machine via VBS -
> like the command "NET TIME \\SERVER /SET /Y"
>
> Cheers.
> Danny



Re: Set the time?? by dude

dude
Wed Apr 28 18:45:27 CDT 2004

Cheers for that. Unfortunatly your reply raises another couple of
questions!

What does %comspec% do/return?
What does the 9, False do?

Cheers,
Danny

On Wed, 28 Apr 2004 15:17:13 -0700, "Charles Blair"
<charles_blair@hotmail.com> wrote:

> Set objShell = Wscript.CreateObject("Wscript.Shell")
> objShell.Run ("%comspec% /c NET TIME \\SERVER /SET /Y"), 0, False
>
>Charles
>
>"dude" <dude@dude.com> wrote in message
>news:7s3u80laqu8hi1dl3vdb52595ffvb8mvdf@4ax.com...
>> Is it possible to synchronise the time of the local machine via VBS -
>> like the command "NET TIME \\SERVER /SET /Y"
>>
>> Cheers.
>> Danny
>


Re: Set the time?? by Al

Al
Wed Apr 28 18:51:58 CDT 2004


"dude" <dude@dude.com> wrote in message
news:mgg0905j46ck3qbgphn2l1rs2k9lqlbg18@4ax.com...
> Cheers for that. Unfortunatly your reply raises another couple of
> questions!
>
> What does %comspec% do/return?

It is an environment variable that provides the path of the default command
processor, typically either cmd.exe or command.com, depending on the o/s
version.

> What does the 9, False do?

It is actually a 0, false, and the zero causes the window to be hidden,
while the false would cause the vbscript to continue running without waiting
for the net command to complete.

/Al

> Cheers,
> Danny
>
> On Wed, 28 Apr 2004 15:17:13 -0700, "Charles Blair"
> <charles_blair@hotmail.com> wrote:
>
> > Set objShell = Wscript.CreateObject("Wscript.Shell")
> > objShell.Run ("%comspec% /c NET TIME \\SERVER /SET /Y"), 0, False
> >
> >Charles
> >
> >"dude" <dude@dude.com> wrote in message
> >news:7s3u80laqu8hi1dl3vdb52595ffvb8mvdf@4ax.com...
> >> Is it possible to synchronise the time of the local machine via VBS -
> >> like the command "NET TIME \\SERVER /SET /Y"
> >>
> >> Cheers.
> >> Danny
> >
>



Re: Set the time?? by Joe

Joe
Thu Apr 29 09:11:56 CDT 2004

Hi,

"dude" <dude@dude.com> wrote in message
news:mgg0905j46ck3qbgphn2l1rs2k9lqlbg18@4ax.com...
> Cheers for that. Unfortunatly your reply raises another couple of
> questions!
>
> What does %comspec% do/return?
> What does the 9, False do?
>
> Cheers,
> Danny

Sounds like you might need the MS CHM file documentation. Use the index to
look up the Run method, and there's a full syntax description.

The WSH (VBScript and JScript) CHM download contains general concepts,
syntax, etc. For the WSH CHM documentation download or any updates, use the
following urls:

http://www.microsoft.com/downloads/search.aspx?displaylang=en
The MS Download Center (English Language)

http://www.microsoft.com/downloads/results.aspx?productID=478EA476-5552-479E-A200-2C33FFD43F24&freetext=&DisplayLang=en
WSH Updates, Documentation and Utility Downloads (English Language)

http://www.microsoft.com/downloads/details.aspx?FamilyID=01592c48-207d-4be1-8a76-1c4099d7bbb9&DisplayLang=en
Windows Scripting Documentation Download (English Language)

For WSH downloads in languages other than English, click on The MS Download
Center link, then select the desired language and click the Go button in the
Worldwide Downloads drop-down box. Once in the appropriate language, select
the equivalent of the Windows Script category in the Product/Technology
drop-down box, and then click the Go button in that box.

Joe Earnest