Jump to content

RunOnce Login Script


Recommended Posts

I am uninstalling an application and need to login to the computer after it reboots to finish the installation. The workstation already has Autologin but I need to login after the reboot. Is there a way to use the RunOnce regkey to do this? Any suggestions is much appreciated.

Link to comment
Share on other sites

It particular, is there some feature/function of AutoIt that you are asking about? This forum is best used for specific advise related ot the langauge itself, if you want help understanding windows functionality you might instead try one of the various MSDN forums or a specialzed forum relating to your specfic topic.

You can indeed write to the RunOnce registry key via AutoIt using RegWrite() if that's what you were woundering about.

Link to comment
Share on other sites

I am using AutoIt to uninstall an application, after it uninstalls I need to log back into the computer with my account to install the new version which is also scripted using AutoIt. I was curious to see if anyone has had success in logging back in using the RunOnce key.

It particular, is there some feature/function of AutoIt that you are asking about? This forum is best used for specific advise related ot the langauge itself, if you want help understanding windows functionality you might instead try one of the various MSDN forums or a specialzed forum relating to your specfic topic.

You can indeed write to the RunOnce registry key via AutoIt using RegWrite() if that's what you were woundering about.

Link to comment
Share on other sites

I and others have made restarting scripts from the runonce key. Use a CLI switch so your script can know it is restarted to do the 2nd part of the operation.

Something like this may show the general idea.

Global $restart

If $CMDLINE[0] And $CMDLINE[1] = '/restart' Then
    $restart = True
EndIf

If $restart Then
    ; Install routine
    ; ...
    Exit
Else
    ; Uninstall routine
    ; ...
    RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce', _
            'ProgramName', 'REG_SZ', _
            '"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & @ScriptFullPath & '" /restart')
    Exit 100
EndIf

:D

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...