Scinner Posted September 7, 2013 Share Posted September 7, 2013 How do I go about importing a server time to an AutoIt script? Link to comment Share on other sites More sharing options...
FireFox Posted September 7, 2013 Share Posted September 7, 2013 Hi,What do you mean by "server time"?Have you tried the _Date_Time* functions?Br, FireFox. Link to comment Share on other sites More sharing options...
abberration Posted September 7, 2013 Share Posted September 7, 2013 I was able to figure out how to bring up the time, but I do not know how to read the window information into a variable. Perhaps a smarter AutoIt user can help with that part? $remoteComputer = "remotecomputername" FileWrite(@ScriptDir & "\remote_time.bat", "net time \\" & $remoteComputer & @CRLF & "pause") ShellExecuteWait (@ScriptDir & "\remote_time.bat") FileDelete(@ScriptDir & "\remote_time.bat") Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
sahsanu Posted September 8, 2013 Share Posted September 8, 2013 (edited) Quick sample: #include <Constants.au3> $computer = "localhost" ;Change the computer name/ip here Local $running = Run(@ComSpec & " /c " & "net time " & "\\" & $computer, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $output While 1 $output &= StdoutRead($running) If @error Then ExitLoop WEnd While 1 $output &= StderrRead($running) If @error Then ExitLoop WEnd Local $array = StringRegExp($output, ".+\ ([0-9]:.+)", 1) If Not @error Then MsgBox(64, "", "Computer " & $computer & " time is " & $array[0]) Edited September 8, 2013 by sahsanu abberration 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now