Sign in to follow this  
Followers 0
wolkenloser

get time from a Server

7 posts in this topic

Hi

I`ve a little script witch set the SYSTEM TIME every 10 seconds.

It should be started invisible but on some PC's - where is running a DOS Programm in Fullscreen - every 10 seconds will resize the Fullscreen window .

This is a Problem and I search a solution for this.

Perhaps someone knows a another command to get the time from a Server ?

I need the RUNASSET command, because not all usrers have the nesseccary rights to get the time from \\timeserver

Here my script:

Opt("TrayIconHide",1)
$iDelay = 1000 * 10 

While 1
    RunAsSet("timeuser", "test", "time")
    shellexecute("NET", "TIME \\TIMESERVER /SET /YES", "", "",  @SW_HIDE )   
    Sleep($iDelay)
    
        
WEnd

greetings

Wolke

Share this post


Link to post
Share on other sites



when i read this, i was thinking about a bit of php and so let a bit of php "echo" the time of that server where it is on. by downloading this file you will get a file with a time in it and i don't know how, but may be you can use that to set the time of the pc.

Arjan

Share this post


Link to post
Share on other sites

...

It should be started invisible but on some PC's - where is running a DOS Programm in Fullscreen - every 10 seconds will resize the Fullscreen window .

Sorry, can you clarify: are those PCs already running a DOS program full screen, and then your time update runs and resizes the already existing DOS program fullscreen-Window?

If so, does it turn the fullscreen window into non-fullscreen and leave it like that?

And what operating system are the systems running?

I remember a problem I had like this a long time ago and can dig up my solution if your problem is actually the same.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@wolkenloser,

I'm told that RunAsSet will have no impact on ShellExecute, try Run or RunWait.

The help file might be a bit misleading on that point.

Changing to Run or RunWait might also cure the screen change problem.

-MSP-

Edit: see this "bug" post http://www.autoitscript.com/forum/index.ph...st&p=367320

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Sorry, can you clarify: are those PCs already running a DOS program full screen,

Yes

and then your time update runs and resizes the already existing DOS program fullscreen-Window?

If so, does it turn the fullscreen window into non-fullscreen and leave it like that?

Yes

And what operating system are the systems running?

XP Spk2

Share this post


Link to post
Share on other sites

Well, I've tried your original script as posted while running different dos apps in full screen mode at the same time and I can't reproduce the problem.

Everything works fine.

The somewhat similar problem I had before was where I couldn't run a DOS command in either a minimized or hidden window, it would always run windowed and so pull focus away from whatever else I was running at the time. But that was on a Windows 98 system as I recall.

The cause was an existing .pif file for, and in the same location as, command.com that had the properties set to run in a standard window. Deleting the .pif solved the problem. The more I think about it, it might even have been with AutoIt v2 and not v3. Sorry :whistle:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0