Is there a way to replicate the results of this:
C:\windows\system32>systeminfo | find "System Boot Time"
System Boot Time: 8/18/2020, 6:39:24 AM
I looked at the built in variable list but didnt find anything.
How to replicate the system boot time command Topic is solved
-
- Posts: 1055
- Joined: 05 May 2018, 12:23
Re: How to replicate the system boot time command
I don't really understand what you mean?
But you can do something like this.
But you can do something like this.
Code: Select all
DetectHiddenWindows, On
F2::
{
ClipSave := ClipboardAll
Run, cmd.exe,,hide,myCMD
WinWait, ahk_pid %myCMD%
ControlSend,, systeminfo | find "System Boot Time" | clip {enter}
sleep 1000
MsgBox %clipboard%
Clipboard := ClipSave
}
return
Re: How to replicate the system boot time command
You can use A_TickCount, which is the number of milliseconds that have elapsed since the system was started, and the current time to calculate the system start time.
Re: How to replicate the system boot time command Topic is solved
In addition to what boiler said, since it might not be obvious, you can use EnvAdd with a negative value to subtract time from the current date, and FormatTime to convert it to a more readable form.
Re: How to replicate the system boot time command
Another way to get System Boot Time... PowerShell wrapped in AHK:AHKStudent wrote: ↑21 Aug 2020, 05:33Is there a way to replicate the results of this:
C:\windows\system32>systeminfo | find "System Boot Time"
Code: Select all
psScript =
(
(gcim Win32_OperatingSystem).LastBootUpTime | Clip
)
RunWait PowerShell.exe -Command %psScript%,, hide
MsgBox, %Clipboard%
Code: Select all
psScript =
(
(get-date) - (gcim Win32_OperatingSystem).LastBootUpTime | Clip
)
RunWait PowerShell.exe -Command %psScript%,, hide
MsgBox, %Clipboard%
Hope this helps...
Who is online
Users browsing this forum: djuga, Google [Bot], Jayinem, manehscripts and 27 guests