Re: Getting system uptime on Windows



I was able to capture the output by first writing the command to a
batch file and then using exec on the .bat file.

set token [open uptime.bat w]
puts $token "net statistics server"
close $token

set data [exec uptime.bat]

file delete uptime.bat



And then it´s just a matter of parsing the output to get the last boot
time. But if anyone else uses this method, be advised that the output
is in the user´s preferred language, so some fancy parsing is required
to be international.

Also, I don´t think this command is available on Windows 98.

.



Relevant Pages

  • Re: VFP 6 - problem with RUN command
    ... I think you simply need to de-bug your .bat file. ... Toos VFP to the side for ... The PAUSE command, however, functions beautifully now. ... and a CALL command to another batch file doesn't work, ...
    (microsoft.public.fox.programmer.exchange)
  • Re: VFP 6 - problem with RUN command
    ... Does your .BAT file run OK if you run it from Windows Explorer? ... and a CALL command to another batch file doesn't work, ... If I place a SUSPEND command immediately before the RUN command, ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Shell & VBA
    ... run the command. ... > SHELL command. ... > When manually I execute this batch file, ...
    (microsoft.public.excel.programming)
  • Re: Command Line Question about Renaming Files
    ... It had to do with how I was sending the commands to the command processor. ... this bat file to work. ... It does rename itself in the process and generates an error, ... I don't fully understand how your batch file works, ...
    (microsoft.public.win2000.general)
  • Re: log off command
    ... I simply execute the batch file and let them play... ... If it's by the hour you don't need a script. ... You can logoff a sessionname or a session ID in each case you have to ... Is it possible to issue the command from user1's logon to logoff ...
    (microsoft.public.windowsxp.basics)