Jump to content
Sign in to follow this  
OmYcroN

Check restart

Recommended Posts

OmYcroN

How can i find out if windows needs to be restarted ? For example Nero knows that this must be done and alerts me. How can i do that in autoit ? It s a value from registry ?

Share this post


Link to post
Share on other sites
martin

How can i find out if windows needs to be restarted ? For example Nero knows that this must be done and alerts me. How can i do that in autoit ? It s a value from registry ?

I would expect that when a program makes some changes, or installs some software which only starts working correctly when Windows restarts, then that program will say that Windows needs to be restarted. I wouldn't expect that there is a way one program would know that another needed Windows to restart, unless you could detect that a more recent version of the kernel had been installed but was not running. I might be wrong of course.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
OmYcroN

You can be right. Thanks anyways ... I m having hard times with nero to install it after office ... i d like to detect if office was instlled in the same session when i start installing nero

Edited by OmYcroN

Share this post


Link to post
Share on other sites
yucatan

You can be right. Thanks anyways ... I m having hard times with nero to install it after office ... i d like to detect if office was instlled in the same session when i start installing nero

just make something lissen

when the autoit script is runned at the end of the script make a reg key or make a file

in the beginning of the script check if the regkey/file exsist if fileexsist "" then exit

or if the file already exsist then its runned one time

in the beginning

if fileexsist run1.txt then

msgbox pc is restarted one time

if fileexsist run2.txt then

msgbox pc is restarted 2 times

like that etc etc further do you understand ?

at the end of the script do

if fileexsist run1.txt then

msgbox pc is restarted one time

filewrite run2.txt

Share this post


Link to post
Share on other sites
martin

just make something lissen

when the autoit script is runned at the end of the script make a reg key or make a file

in the beginning of the script check if the regkey/file exsist if fileexsist "" then exit

or if the file already exsist then its runned one time

in the beginning

if fileexsist run1.txt then

msgbox pc is restarted one time

if fileexsist run2.txt then

msgbox pc is restarted 2 times

like that etc etc further do you understand ?

No.

at the end of the script do

if fileexsist run1.txt then

msgbox pc is restarted one time

filewrite run2.txt

Maybe you are talking about RunOnce which is a registry entry for programs to be run when Windows starts, and once started Windows deletes the registry entry so it isn't run again next time Windows starts.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
damian666

well, i could be wrong, but i think there is indeed a kind of a regentry for that on windows...

beats me what it is, but i have seen other programs tell me that there was a unfinished program install, and that i needed ot reboot before the next program could be installed so.

it could really well be runonce btw...

Damian666


and proud of it!!!

Share this post


Link to post
Share on other sites
inet

just make something lissen

when the autoit script is runned at the end of the script make a reg key or make a file

in the beginning of the script check if the regkey/file exsist if fileexsist "" then exit

or if the file already exsist then its runned one time

in the beginning

if fileexsist run1.txt then

msgbox pc is restarted one time

if fileexsist run2.txt then

msgbox pc is restarted 2 times

like that etc etc further do you understand ?

at the end of the script do

if fileexsist run1.txt then

msgbox pc is restarted one time

filewrite run2.txt

this will NOT check if a reboot is NEEDED. It will only look if there HAS BEEN a reboot, so that won't help.

Try this:

Func Check_Reboot()
    $a_Value = RegRead("HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile", "Flags")
    If @error Or $a_Value == 0 Then
        $a_Status = 0
    Else
        $a_Status = 1
    EndIf

    SetError(0)

    $b_Value = RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager", "PendingFileRenameOperations")
    If @error Then
        $b_Status = 0
    Else
        $b_Status = 1
    EndIf

    If $a_Status == 1 Or $b_Status == 1 Then;Computer needs reboot
        Return True
    EndIf
EndFunc

Share this post


Link to post
Share on other sites
damian666

wow, thats a nice function man, thanx...

so i was right about that regentry :)

cool

Damian666


and proud of it!!!

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.